ast_unary needs to set its type

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-18 20:02:18 +02:00
parent 7cc1609117
commit 99fe673f0a

5
ast.c
View file

@ -322,6 +322,11 @@ ast_unary* ast_unary_new(lex_ctx ctx, int op,
self->op = op; self->op = op;
self->operand = expr; self->operand = expr;
if (op >= INSTR_NOT_F && op <= INSTR_NOT_FNC) {
self->expression.vtype = TYPE_FLOAT;
} else
asterror(ctx, "cannot determine type of unary operation %s", asm_instr[op].m);
return self; return self;
} }