ast_store needs to take over the type of its destination

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-10-28 20:02:57 +01:00
parent cd8043fc18
commit 90571a6151

11
ast.c
View file

@ -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;
}