]> 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>
Tue, 23 Oct 2018 16:45:49 +0000 (18:45 +0200)
vala/valaassignment.vala
vala/valareturnstatement.vala

index d00e2f011e1a8b7c21753cb61a3597649944ec6c..abb225662b223a5343314cefb2e1c03e61c93196 100644 (file)
@@ -221,10 +221,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");
@@ -247,7 +247,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;
 
@@ -315,7 +315,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 cdb782cf29367634fa17975373935c8c94b46768..f51164968d69d81c99a22598674ab83afc49dfc6 100644 (file)
@@ -84,7 +84,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)) {