same as before for loops: don't try creating a jump if the body ends in a return

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-19 19:45:53 +02:00
parent 49cd86e8ed
commit 4254845227

2
ast.c
View file

@ -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;
}