Commit 920e9475 authored by Rico Tzschichholz's avatar Rico Tzschichholz

codegen: Avoid critical for array in-parameters with custom length-type

Regression of 049b9b39
parent 4a76af73
......@@ -366,7 +366,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
CCodeExpression? array_length_expr = null;
if (get_ccode_array_length_type (param) != null) {
string length_ctype = get_ccode_array_length_type (param);
if (unary.operator == UnaryOperator.REF) {
if (unary != null && unary.operator == UnaryOperator.REF) {
length_ctype = "%s*".printf (length_ctype);
}
array_length_expr = new CCodeCastExpression (get_array_length_cexpression (arg, dim), length_ctype);
......
void foo ([CCode (array_length_type = "gsize")] ref uint8[] a) {
}
void bar ([CCode (array_length_type = "gsize")] uint8[] a) {
}
void main () {
uint8[] a = new uint8[32];
foo (ref a);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment