From: Wolfgang (Blub) Bumiller Date: Sun, 19 Aug 2012 17:43:41 +0000 (+0200) Subject: don't try to create jumps in ifs if the block is already done X-Git-Tag: 0.1-rc1~151 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=49cd86e8ed8aa2675131c6fe8d5b71b18b7aab40;p=xonotic%2Fgmqcc.git don't try to create jumps in ifs if the block is already done --- diff --git a/ast.c b/ast.c index 1570388..d0d4334 100644 --- 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 :)