]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Fix wrong merge_id
authorWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 21 Nov 2012 18:55:12 +0000 (19:55 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Wed, 21 Nov 2012 18:55:12 +0000 (19:55 +0100)
ast.c

diff --git a/ast.c b/ast.c
index 48605afe0f2b9711bcba4652aedb37344b19b8fc..3bfb9182754c03cc3cae59fb7cda4900649bcaaf 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1532,7 +1532,7 @@ bool ast_binary_codegen(ast_binary *self, ast_function *func, bool lvalue, ir_va
          * but we translate this to (!(!a ? !a : !b))
          */
 
-        merge_id = vec_size(func->blocks);
+        merge_id = vec_size(func->ir_func->blocks);
         merge = ir_function_create_block(func->ir_func, ast_function_label(func, "sce_merge"));
 
         cgen = self->left->expression.codegen;
@@ -1601,6 +1601,8 @@ bool ast_binary_codegen(ast_binary *self, ast_function *func, bool lvalue, ir_va
                                          notop,
                                          *out);
         }
+        if (!*out)
+            return false;
         self->expression.outr = *out;
         return true;
     }