]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codegen: Initialize internal temp-variables used as reference parameter e1297d92dcb7fb0f683edee7a1e48a1947b29e9c
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 8 Oct 2018 19:03:50 +0000 (21:03 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 8 Oct 2018 19:09:50 +0000 (21:09 +0200)
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

index 0e800cba87cc9c2aed1bd1102a2d9cccb296abcd..4c24ba96983629623628c6b01d56f1421b9f6021 100644 (file)
@@ -515,9 +515,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);
 
@@ -535,7 +535,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);
@@ -545,7 +545,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);
@@ -581,7 +581,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);
@@ -596,7 +596,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);
@@ -606,7 +606,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);