[vala/0.44] codegen: Initialize delegate temp-var which is assigned by property getter



commit 6392e39353b1c0bccc9beea91ee1df3c241bd5ec
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Oct 2 18:19:53 2019 +0200

    codegen: Initialize delegate temp-var which is assigned by property getter
    
    Found by -Werror=maybe-uninitialized

 codegen/valaccodememberaccessmodule.vala | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 1f72c1f0e..8fb01eaa6 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]