summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-03-17 15:26:36 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2020-03-17 15:35:01 +0100
commit76ba3c3a6bb7f304bccf2bd03176101a72d260ae (patch)
treedd253f8c74eb944957421c7bc73e28c880abba1c
parentd33e9fbca63674b7dfa339c25a9d5e27cce187f3 (diff)
downloadvala-76ba3c3a6bb7f304bccf2bd03176101a72d260ae.tar.gz
codegen: Use correctly typed array-length variable for delegate invocation
-rw-r--r--codegen/valaccodemethodcallmodule.vala3
1 files changed, 2 insertions, 1 deletions
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index 17df1cda4..07ec2df6c 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -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);