]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - ast.c
replacing the current [[accumulate]] implementation: shorter and simpler, and also...
[xonotic/gmqcc.git] / ast.c
diff --git a/ast.c b/ast.c
index cf03e017d9c418a959c838a74387c73c14e815ad..dbd23f14db04889f3e17a0b977db503aac5904dc 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -529,7 +529,7 @@ 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 == op))
+        if (((ast_unary*)expr)->op == op)
             prev = (ast_unary*)((ast_unary*)expr)->operand;
 
         if (ast_istype(prev, ast_unary)) {
@@ -1183,6 +1183,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,
@@ -1792,6 +1793,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;