[vala/0.40] codegen: Initialize internal temp-variables used as reference parameter



commit e3d98d9174f196a982803c28ce916f9615f9fe80
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Oct 8 21:03:50 2018 +0200

    codegen: Initialize internal temp-variables used as reference parameter
    
    Variables for delegate-targets and array-lengths passed as reference in
    method calls should be initialized to fix "make check" with -O3.

 codegen/valaccodemethodcallmodule.vala | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala
index 27fb74110..eb65929bd 100644
--- a/codegen/valaccodemethodcallmodule.vala
+++ b/codegen/valaccodemethodcallmodule.vala
@@ -509,9 +509,9 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                        LocalVariable temp_var;
 
                                        if (get_ccode_array_length_type (m) == null) {
-                                               temp_var = get_temp_variable (int_type);
+                                               temp_var = get_temp_variable (int_type, true, null, true);
                                        } else {
-                                               temp_var = get_temp_variable (new CType 
(get_ccode_array_length_type (m)));
+                                               temp_var = get_temp_variable (new CType 
(get_ccode_array_length_type (m)), true, null, true);
                                        }
                                        var temp_ref = get_variable_cexpression (temp_var.name);
 
@@ -529,7 +529,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                } else if (m != null && m.return_type is DelegateType && async_call != ccall) {
                        var deleg_type = (DelegateType) m.return_type;
                        if (deleg_type.delegate_symbol.has_target) {
-                               var temp_var = get_temp_variable (new PointerType (new VoidType ()));
+                               var temp_var = get_temp_variable (new PointerType (new VoidType ()), true, 
null, true);
                                var temp_ref = get_variable_cexpression (temp_var.name);
 
                                emit_temp_var (temp_var);
@@ -539,7 +539,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                set_delegate_target (expr, temp_ref);
 
                                if (deleg_type.is_disposable ()) {
-                                       temp_var = get_temp_variable (gdestroynotify_type);
+                                       temp_var = get_temp_variable (gdestroynotify_type, true, null, true);
                                        temp_ref = get_variable_cexpression (temp_var.name);
 
                                        emit_temp_var (temp_var);
@@ -575,7 +575,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
 
                                        append_array_length (expr, len_call);
                                } else if (get_ccode_array_length (deleg)) {
-                                       var temp_var = get_temp_variable (int_type);
+                                       var temp_var = get_temp_variable (int_type, true, null, true);
                                        var temp_ref = get_variable_cexpression (temp_var.name);
 
                                        emit_temp_var (temp_var);
@@ -590,7 +590,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                } else if (deleg != null && deleg.return_type is DelegateType) {
                        var deleg_type = (DelegateType) deleg.return_type;
                        if (deleg_type.delegate_symbol.has_target) {
-                               var temp_var = get_temp_variable (new PointerType (new VoidType ()));
+                               var temp_var = get_temp_variable (new PointerType (new VoidType ()), true, 
null, true);
                                var temp_ref = get_variable_cexpression (temp_var.name);
 
                                emit_temp_var (temp_var);
@@ -600,7 +600,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                set_delegate_target (expr, temp_ref);
 
                                if (deleg_type.is_disposable ()) {
-                                       temp_var = get_temp_variable (gdestroynotify_type);
+                                       temp_var = get_temp_variable (gdestroynotify_type, true, null, true);
                                        temp_ref = get_variable_cexpression (temp_var.name);
 
                                        emit_temp_var (temp_var);


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