]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
same as before for loops: don't try creating a jump if the body ends in a return
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 17:45:53 +0000 (19:45 +0200)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sun, 19 Aug 2012 17:45:53 +0000 (19:45 +0200)
ast.c

diff --git a/ast.c b/ast.c
index d0d4334c65e1aabb0c38f85b6681198d6bb61e75..7c349b4638657b2cfa52dbe8866479dcf4e65199 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1653,7 +1653,7 @@ bool ast_loop_codegen(ast_loop *self, ast_function *func, bool lvalue, ir_value
         else if (bpostcond)  tmpblock = bpostcond;
         else if (bprecond)   tmpblock = bprecond;
         else                 tmpblock = bout;
-        if (!ir_block_create_jump(end_bbody, tmpblock))
+        if (!end_bbody->final && !ir_block_create_jump(end_bbody, tmpblock))
             return false;
     }