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



commit 8d9616e03015d6d80447562d83a3cbcd7ef127b1
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 2175a49c9..1d6b94b60 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);
 
@@ -527,7 +527,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);
@@ -537,7 +537,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);
@@ -573,7 +573,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);
@@ -588,7 +588,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);
@@ -598,7 +598,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]