]> 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>
Thu, 3 Oct 2019 07:33:15 +0000 (09:33 +0200)
Found by -Werror=maybe-uninitialized

codegen/valaccodememberaccessmodule.vala

index 24e0cedf8d3298e82b41583dc87356670343cdcf..8dc720aa5d001ba9b22ff04b8a06eadcf426feb7 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);