]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Use correctly typed array-length variable for delegate invocation
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 17 Mar 2020 14:26:36 +0000 (15:26 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 17 Mar 2020 14:35:01 +0000 (15:35 +0100)
codegen/valaccodemethodcallmodule.vala

index 17df1cda43933ffe93e4c09c752310ffdd7cfcd4..07ec2df6ca97eb378786fe926f238a33ae64da03 100644 (file)
@@ -608,7 +608,8 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
 
                                        append_array_length (expr, len_call);
                                } else if (get_ccode_array_length (deleg)) {
-                                       var temp_var = get_temp_variable (array_type.length_type, true, null, true);
+                                       var length_ctype = get_ccode_array_length_type (deleg) ?? get_ccode_array_length_type (array_type);
+                                       var temp_var = get_temp_variable (new CType (length_ctype, "0"), true, null, true);
                                        var temp_ref = get_variable_cexpression (temp_var.name);
 
                                        emit_temp_var (temp_var);