]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Initialize delegate temp-var which is assigned by property getter
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 2 Oct 2019 16:19:53 +0000 (18:19 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 5 Oct 2019 11:45:55 +0000 (13:45 +0200)
Found by -Werror=maybe-uninitialized

codegen/valaccodememberaccessmodule.vala

index 1f72c1f0ebbb97b25c1eaf785ea6953b0dfe5157..8fb01eaa6fab14f937470ee28232dc3dee834405 100644 (file)
@@ -254,7 +254,8 @@ public abstract class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
                                }
 
                                bool prop_is_real_non_null_struct_type = prop.property_type.is_real_non_null_struct_type ();
-                               var temp_value = (GLibValue) create_temp_value (prop.get_accessor.value_type, prop_is_real_non_null_struct_type, expr);
+                               bool requires_init = prop.property_type is DelegateType || prop_is_real_non_null_struct_type;
+                               var temp_value = (GLibValue) create_temp_value (prop.get_accessor.value_type, requires_init, expr);
                                expr.target_value = load_temp_value (temp_value);
                                var ctemp = get_cvalue_ (temp_value);