diff options
Diffstat (limited to 'src/vm.c')
| -rw-r--r-- | src/vm.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -1474,12 +1474,7 @@ RETRY_TRY_BLOCK: mrb->jmp = prev_jmp; MRB_THROW(prev_jmp); } - if (ci > mrb->c->cibase) { - while (eidx > ci[-1].eidx) { - ecall(mrb, --eidx); - } - } - else if (ci == mrb->c->cibase) { + if (ci == mrb->c->cibase) { if (ci->ridx == 0) { if (mrb->c == mrb->root_c) { regs = mrb->c->stack = mrb->c->stbase; @@ -1495,6 +1490,12 @@ RETRY_TRY_BLOCK: } break; } + /* call ensure only when we skip this callinfo */ + if (ci[0].ridx == ci[-1].ridx) { + while (eidx > ci[-1].eidx) { + ecall(mrb, --eidx); + } + } } L_RESCUE: if (ci->ridx == 0) goto L_STOP; |
