]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: More copying of dedicated data-type instances for code-nodes
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 13 Nov 2020 21:51:53 +0000 (22:51 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 14 Nov 2020 14:57:22 +0000 (15:57 +0100)
codegen/valaccodemethodcallmodule.vala
vala/valabaseaccess.vala
vala/valabinaryexpression.vala
vala/valabooleanliteral.vala
vala/valacastexpression.vala
vala/valaelementaccess.vala
vala/valapointerindirection.vala
vala/valasizeofexpression.vala
vala/valatypecheck.vala
vala/valatypeofexpression.vala
vala/valaunaryexpression.vala

index 2d10ad046a845714975dded7cb734b18eafc876c..c196928c8b1c01d9dff0f0b60e3f4d8be30ff75d 100644 (file)
@@ -431,7 +431,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                                var temp_var = get_temp_variable (param.variable_type, param.variable_type.value_owned, null, true);
                                                emit_temp_var (temp_var);
                                                set_cvalue (arg, get_variable_cexpression (temp_var.name));
-                                               arg.target_value.value_type = arg.target_type;
+                                               arg.target_value.value_type = arg.target_type.copy ();
 
                                                cexpr = new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, get_cvalue (arg));
 
@@ -476,7 +476,7 @@ public class Vala.CCodeMethodCallModule : CCodeAssignmentModule {
                                        var temp_var = get_temp_variable (arg.value_type, arg.value_type.value_owned, null, true);
                                        emit_temp_var (temp_var);
                                        set_cvalue (arg, get_variable_cexpression (temp_var.name));
-                                       arg.target_value.value_type = arg.value_type;
+                                       arg.target_value.value_type = arg.value_type.copy ();
 
                                        if (arg.value_type is DelegateType && ((DelegateType) arg.value_type).delegate_symbol.has_target) {
                                                // Initialize target/destroy cvalues to allow assignment of delegates from varargs
index 14258af144cd12583a9d3b0c7afb2533a2e3ba40..32458feee610c956d57f202b4a0e08d7411a3ee1 100644 (file)
@@ -72,7 +72,7 @@ public class Vala.BaseAccess : Expression {
                                Report.error (source_reference, "Base access invalid without base type");
                                return false;
                        }
-                       value_type = context.analyzer.current_struct.base_type;
+                       value_type = context.analyzer.current_struct.base_type.copy ();
                } else if (context.analyzer.current_class.base_class == null) {
                        error = true;
                        Report.error (source_reference, "Base access invalid without base class");
index f831c7cb7b2b61df73ab95584234b4e0c32f5c5d..f434ba87782b6c135c9d2b93e59f7edc9803a8cc 100644 (file)
@@ -416,7 +416,7 @@ public class Vala.BinaryExpression : Expression {
                                        }
                                } else if (right.value_type is PointerType) {
                                        // pointer arithmetic: pointer - pointer
-                                       value_type = context.analyzer.size_t_type;
+                                       value_type = context.analyzer.size_t_type.copy ();
                                }
                        } else {
                                left.target_type.nullable = false;
@@ -480,7 +480,7 @@ public class Vala.BinaryExpression : Expression {
                                right.target_type.nullable = false;
                        }
 
-                       value_type = context.analyzer.bool_type;
+                       value_type = context.analyzer.bool_type.copy ();
                        break;
                case BinaryOperator.EQUALITY:
                case BinaryOperator.INEQUALITY:
@@ -534,7 +534,7 @@ public class Vala.BinaryExpression : Expression {
                                right.target_type.nullable = true;
                        }
 
-                       value_type = context.analyzer.bool_type;
+                       value_type = context.analyzer.bool_type.copy ();
                        break;
                case BinaryOperator.BITWISE_AND:
                case BinaryOperator.BITWISE_OR:
@@ -560,7 +560,7 @@ public class Vala.BinaryExpression : Expression {
                        left.target_type.nullable = false;
                        right.target_type.nullable = false;
 
-                       value_type = context.analyzer.bool_type;
+                       value_type = context.analyzer.bool_type.copy ();
                        break;
                case BinaryOperator.IN:
                        if (left.value_type.compatible (context.analyzer.int_type)
@@ -598,7 +598,7 @@ public class Vala.BinaryExpression : Expression {
                                return contains_call.check (context);
                        }
 
-                       value_type = context.analyzer.bool_type;
+                       value_type = context.analyzer.bool_type.copy ();
                        break;
                default:
                        error = true;
index db3a6b5cfd237680ce8238c9d7acc540b59fbd9b..0cef20d6f9694b126d8a9aa7926c562d554f3f4d 100644 (file)
@@ -68,7 +68,7 @@ public class Vala.BooleanLiteral : Literal {
 
                checked = true;
 
-               value_type = context.analyzer.bool_type;
+               value_type = context.analyzer.bool_type.copy ();
 
                return !error;
        }
index 86b9f9a1289f0ffbaadfb56b0610e7c2483ae947..0bc9d5cbf3e93e670fb3b0216a837b1688c74c4b 100644 (file)
@@ -193,7 +193,7 @@ public class Vala.CastExpression : Expression {
                        return temp_access.check (context);
                }
 
-               value_type = type_reference;
+               value_type = type_reference.copy ();
                value_type.value_owned = inner.value_type.value_owned;
                value_type.floating_reference = inner.value_type.floating_reference;
 
index d866d2f0b894c32df0ae1dd170f5d203ca6064b4..fb1c764fbda36021b7055f963b24666322e0ab16 100644 (file)
@@ -209,7 +209,7 @@ public class Vala.ElementAccess : Expression {
                        index_int_type_check = false;
 
                        symbol_reference = container.symbol_reference;
-                       value_type = container.value_type;
+                       value_type = container.value_type.copy ();
                } else {
                        if (lvalue) {
                                var set_method = container.value_type.get_member ("set") as Method;
index bcf32b548228b64feb3dde7985317504c20c43d7..0397eb37ca6212d2513ec049284b181d3313cb70 100644 (file)
@@ -101,7 +101,7 @@ public class Vala.PointerIndirection : Expression {
                                Report.error (source_reference, "Pointer indirection not supported for this expression");
                                return false;
                        }
-                       value_type = pointer_type.base_type;
+                       value_type = pointer_type.base_type.copy ();
                } else {
                        error = true;
                        Report.error (source_reference, "Pointer indirection not supported for this expression");
index 1942b8eede2282f24eea3c534a2213c938d9709c..53ad29038c83204b119cb31fbb5ef37aa5ef6229 100644 (file)
@@ -84,7 +84,7 @@ public class Vala.SizeofExpression : Expression {
 
                type_reference.check (context);
 
-               value_type = context.analyzer.ulong_type;
+               value_type = context.analyzer.ulong_type.copy ();
 
                return !error;
        }
index 848b4f45743224c8eae9369138669b7f6845b39e..d031e842b60214dc13efce5483f838ac235841fd 100644 (file)
@@ -126,7 +126,7 @@ public class Vala.TypeCheck : Expression {
                        Report.warning (_data_type.source_reference, "Type argument list has no effect");
                }
 
-               value_type = context.analyzer.bool_type;
+               value_type = context.analyzer.bool_type.copy ();
 
                return !error;
        }
index 2449b6086fad8db3fe67a51a7a1373f10bc57a0a..97259afb1478b06d53a203e1b3d9af70d9ea8734 100644 (file)
@@ -80,7 +80,7 @@ public class Vala.TypeofExpression : Expression {
 
                type_reference.check (context);
 
-               value_type = context.analyzer.type_type;
+               value_type = context.analyzer.type_type.copy ();
 
                if (context.profile == Profile.GOBJECT && type_reference.has_type_arguments ()) {
                        Report.warning (_data_type.source_reference, "Type argument list without effect");
index 76c31cd7aba254913cf427b2bf200cbdf594e1da..a46a4a9c26ddc5cf369d9f311c878af424541083 100644 (file)
@@ -176,7 +176,7 @@ public class Vala.UnaryExpression : Expression {
                                return false;
                        }
 
-                       value_type = inner.value_type;
+                       value_type = inner.value_type.copy ();
                        break;
                case UnaryOperator.LOGICAL_NEGATION:
                        // boolean type
@@ -186,7 +186,7 @@ public class Vala.UnaryExpression : Expression {
                                return false;
                        }
 
-                       value_type = inner.value_type;
+                       value_type = inner.value_type.copy ();
                        break;
                case UnaryOperator.BITWISE_COMPLEMENT:
                        // integer type
@@ -196,7 +196,7 @@ public class Vala.UnaryExpression : Expression {
                                return false;
                        }
 
-                       value_type = inner.value_type;
+                       value_type = inner.value_type.copy ();
                        break;
                case UnaryOperator.INCREMENT:
                case UnaryOperator.DECREMENT:
@@ -214,7 +214,7 @@ public class Vala.UnaryExpression : Expression {
                                return false;
                        }
 
-                       value_type = inner.value_type;
+                       value_type = inner.value_type.copy ();
                        break;
                case UnaryOperator.REF:
                case UnaryOperator.OUT:
@@ -223,7 +223,7 @@ public class Vala.UnaryExpression : Expression {
                            (ea != null && ea.container.value_type is ArrayType)) {
                                // ref and out can only be used with fields, parameters, local variables, and array element access
                                lvalue = true;
-                               value_type = inner.value_type;
+                               value_type = inner.value_type.copy ();
                        } else {
                                error = true;
                                Report.error (source_reference, "ref and out method arguments can only be used with fields, parameters, local variables, and array element access");