X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=ast.c;h=3c70a73721e49e726c1e010b3bbc0b77e94bc225;hb=aee68d80ea654474afe2183e526a0e25d626e799;hp=dc90019c71e714dc1d8e38f6bb9fb18ea5bd885f;hpb=b6f08e7fb1bbe347bbc8de38f6e5af924cfd7c6b;p=xonotic%2Fgmqcc.git diff --git a/ast.c b/ast.c index dc90019..3c70a73 100644 --- a/ast.c +++ b/ast.c @@ -523,10 +523,8 @@ ast_unary* ast_unary_new(lex_ctx_t ctx, int op, ast_unary *prev = (ast_unary*)((ast_unary*)expr)->operand; /* Handle for double negation */ - if ((((ast_unary*)expr)->op == VINSTR_NEG_V && op == VINSTR_NEG_V) || - (((ast_unary*)expr)->op == VINSTR_NEG_F && op == VINSTR_NEG_F)) { + if (((ast_unary*)expr)->op == op) prev = (ast_unary*)((ast_unary*)expr)->operand; - } if (ast_istype(prev, ast_unary)) { ast_expression_delete((ast_expression*)self); @@ -1179,6 +1177,7 @@ ast_function* ast_function_new(lex_ctx_t ctx, const char *name, ast_value *vtype if (!vtype) { compile_error(ast_ctx(self), "internal error: ast_function_new condition 0"); goto cleanup; + } else if (vtype->hasvalue || vtype->expression.vtype != TYPE_FUNCTION) { } else if (vtype->hasvalue || vtype->expression.vtype != TYPE_FUNCTION) { compile_error(ast_ctx(self), "internal error: ast_function_new condition %i %i type=%i (probably 2 bodies?)", (int)!vtype, @@ -1788,6 +1787,7 @@ bool ast_function_codegen(ast_function *self, ir_builder *ir) ir_value *dummy; ast_expression *ec; ast_expression_codegen *cgen; + size_t i; (void)ir;