don't try to create jumps in ifs if the block is already done

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-19 19:43:41 +02:00
parent adda894976
commit 49cd86e8ed

4
ast.c
View file

@ -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 :)