ast_ternary needs to adopt the output type

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-11-21 20:57:00 +01:00
parent 9c8dc43775
commit e20184ae59

5
ast.c
View file

@ -652,6 +652,11 @@ ast_ternary* ast_ternary_new(lex_ctx ctx, ast_expression *cond, ast_expression *
self->on_true = ontrue;
self->on_false = onfalse;
if (!ast_type_adopt(self, ontrue)) {
ast_ternary_delete(self);
return NULL;
}
return self;
}