]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
ast_unary needs to set its type
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 18:02:18 +0000 (20:02 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 18 Aug 2012 18:02:18 +0000 (20:02 +0200)
ast.c

diff --git a/ast.c b/ast.c
index c3dfe21a281acff9561fb1addd31e9e14cd0bd9d..3d8d45feeec65dfc9515b5065a429178425d673e 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -322,6 +322,11 @@ ast_unary* ast_unary_new(lex_ctx ctx, int op,
     self->op = op;
     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;
 }