geb = new BasicBlock(cfg, new Label("_GLOBAL_ENSURE_BLOCK"));
Variable exc = getNewTemporaryVariable();
geb.addInstr(new ReceiveExceptionInstr(exc, false)); // No need to check type since it is not used before rethrowing
// Handle uncaught break using runtime helper
// --> IRRuntimeHelpers.catchUncaughtBreakInLambdas(context, scope, bj, blockType)
geb.addInstr(new RuntimeHelperCall(null, "catchUncaughtBreakInLambdas", new Operand[]{exc} ));
cfg.addGlobalEnsureBB(geb);
} else {
// SSS FIXME: Assumptions:
//
// First instr is a 'ReceiveExceptionInstr'
// Last instr is a 'ThrowExceptionInstr'
List<Instr> instrs = geb.getInstrs();
Variable exc = ((ReceiveExceptionInstr)instrs.get(0)).getResult();
instrs.set(instrs.size(), new RuntimeHelperCall(null, "catchUncaughtBreakInLambdas", new Operand[]{exc} ));
}
// Update scope
addedGEBForUncaughtBreaks = true;