]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
don't try to create jumps in ifs if the block is already done
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 17:43:41 +0000 (19:43 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 17:43:41 +0000 (19:43 +0200)
ast.c

diff --git a/ast.c b/ast.c
index 15703886e353fd318c8c10faf9ee96c686cb58af..d0d4334c65e1aabb0c38f85b6681198d6bb61e75 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1333,9 +1333,9 @@ bool ast_ifthen_codegen(ast_ifthen *self, ast_function *func, bool lvalue, ir_va
         return false;
 
     /* add jumps ot the merge block */
-    if (ontrue && !ir_block_create_jump(ontrue, merge))
+    if (ontrue && !ontrue->final && !ir_block_create_jump(ontrue, merge))
         return false;
-    if (onfalse && !ir_block_create_jump(onfalse, merge))
+    if (onfalse && !onfalse->final && !ir_block_create_jump(onfalse, merge))
         return false;
 
     /* we create the if here, that way all blocks are ordered :)