]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Add some missing type copying
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 23 Oct 2018 13:05:30 +0000 (15:05 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 27 Oct 2018 20:40:30 +0000 (22:40 +0200)
vala/valaassignment.vala
vala/valareturnstatement.vala

index 1d1ed135013d8d9cca0cda105295e527ff11dc76..a3038c309c294bbc79250a3980e062b0fbb89e4a 100644 (file)
@@ -210,10 +210,10 @@ public class Vala.Assignment : Expression {
                                parent_node.replace_expression (this, set_call);
                                return set_call.check (context);
                        } else {
-                               right.target_type = left.value_type;
+                               right.target_type = left.value_type.copy ();
                        }
                } else if (left is PointerIndirection) {
-                       right.target_type = left.value_type;
+                       right.target_type = left.value_type.copy ();
                } else {
                        error = true;
                        Report.error (source_reference, "unsupported lvalue in assignment");
@@ -237,7 +237,7 @@ public class Vala.Assignment : Expression {
                                var old_value = new MemberAccess (ma.inner, ma.member_name);
 
                                var bin = new BinaryExpression (BinaryOperator.PLUS, old_value, right, source_reference);
-                               bin.target_type = right.target_type;
+                               bin.target_type = right.target_type.copy ();
                                right.target_type = right.target_type.copy ();
                                right.target_type.value_owned = false;
 
@@ -341,7 +341,7 @@ public class Vala.Assignment : Expression {
                                                return false;
                                        }
 
-                                       right.value_type = variable.variable_type;
+                                       right.value_type = variable.variable_type.copy ();
                                } else {
                                        error = true;
                                        Report.error (source_reference, "Assignment: Invalid assignment attempt");
index 83e81a2cc9cd46e726b713c9a58df0663c6bc985..543017d54bb588416a3fef9a0494bbbcaa09d819 100644 (file)
@@ -78,7 +78,7 @@ public class Vala.ReturnStatement : CodeNode, Statement {
                checked = true;
 
                if (return_expression != null) {
-                       return_expression.target_type = context.analyzer.current_return_type;
+                       return_expression.target_type = context.analyzer.current_return_type.copy ();
                }
 
                if (return_expression != null && !return_expression.check (context)) {