private void buildRescueBodyInternal(IRScope m, Node node, Variable rv, Label endLabel, List<Label> rescueBlockLabels) {
final RescueBodyNode rescueBodyNode = (RescueBodyNode) node;
final Node exceptionList = rescueBodyNode.getExceptionNodes();
// Load exception & exception comparison type
Variable exc = m.getNewTemporaryVariable();
m.addInstr(new RECV_EXCEPTION_Instr(exc));
// SSS: FIXME: Is this correct?
// Compute all elements of the exception array eagerly
// Operand excType = (exceptionList == null) ? null : build(exceptionList, m);
// Compare and branch as necessary!
Label uncaughtLabel = null;
if (exceptionList != null) {
uncaughtLabel = m.getNewLabel();
Variable eqqResult = m.getNewTemporaryVariable();
for (Node excType : ((ListNode) exceptionList).childNodes()) {
m.addInstr(new EQQInstr(eqqResult, build(excType, m), exc));
m.addInstr(new BEQInstr(eqqResult, BooleanLiteral.FALSE, uncaughtLabel));
}
}