if (loop) {
// now do the codegen for each break/continue block
for (Loop *it = loop, *it2 = _loop; it && it2; it = it->parent, it2 = it2->parent) {
- generateFinallyBlock(it->breakBlock, !catchBody, ast->finallyExpression->statement, hasException, it2->breakBlock);
- generateFinallyBlock(it->continueBlock, !catchBody, ast->finallyExpression->statement, hasException, it2->continueBlock);
+ // if the break/continue trampoline blocks get reached, there cannot
+ // be a pending exception, so don't bother with saving it.
+ generateFinallyBlock(it->breakBlock, false, ast->finallyExpression->statement, hasException, it2->breakBlock);
+ generateFinallyBlock(it->continueBlock, false, ast->finallyExpression->statement, hasException, it2->continueBlock);
}
// we don't need the Loop struct itself anymore.
_block = realFinallyBlock;
}
+ // TODO: this will not re-throw when there is a pending exception, and
+ // the finally block contains a break/continue. Should another set of
+ // break/continue trampoline blocks get inserted?
_block->EXP(_block->CALL(_block->NAME(IR::Name::builtin_delete_exception_handler, 0, 0), 0));
if (ast)
statement(ast);
bool Codegen::visit(WithStatement *)
{
- assert(!"not implemented");
+ assert(!"with not implemented");
return false;
}