]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
ast_store needs to take over the type of its destination
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 28 Oct 2012 19:02:57 +0000 (20:02 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 28 Oct 2012 19:02:57 +0000 (20:02 +0100)
ast.c

diff --git a/ast.c b/ast.c
index a0af13022ebd8585252af91e36eca44bd983e793..2350e20ba12fe3b6cc64224a2a011a27f0a58698 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -616,6 +616,17 @@ ast_store* ast_store_new(lex_ctx ctx, int op,
     self->dest = dest;
     self->source = source;
 
+    self->expression.vtype = dest->expression.vtype;
+    if (dest->expression.next) {
+        self->expression.next = ast_type_copy(ctx, dest);
+        if (!self->expression.next) {
+            ast_delete(self);
+            return NULL;
+        }
+    }
+    else
+        self->expression.next = NULL;
+
     return self;
 }