diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-28 21:44:56 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-10-28 23:10:28 +0900 |
| commit | 92e24f809b75d4b077fcde302b1f7d5cf9bac6bb (patch) | |
| tree | 299d5e4f5aa60a83dea1f60b628cea3c186758d2 /src | |
| parent | c7c9543bed57db12fd8aa57391e0b652ee27cb23 (diff) | |
| download | mruby-92e24f809b75d4b077fcde302b1f7d5cf9bac6bb.tar.gz mruby-92e24f809b75d4b077fcde302b1f7d5cf9bac6bb.zip | |
Should check if `callinfo` stack is popped before updating the stack.
This is a resurrection of 75c374c, which is accidentally removed by
93f5f22; Fix #3507 #3512 #3518 #3521
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1845,10 +1845,11 @@ RETRY_TRY_BLOCK: } if (mrb->exc) { + mrb_callinfo *ci0; mrb_value *stk; L_RAISE: - ci = mrb->c->ci; + ci0 = ci = mrb->c->ci; if (ci == mrb->c->cibase) { if (ci->ridx == 0) goto L_FTOP; goto L_RESCUE; @@ -1900,7 +1901,9 @@ RETRY_TRY_BLOCK: irep = proc->body.irep; pool = irep->pool; syms = irep->syms; - mrb->c->stack = ci[1].stackent; + if (ci < ci0) { + mrb->c->stack = ci[1].stackent; + } stack_extend(mrb, irep->nregs); pc = mrb->c->rescue[--ci->ridx]; } |
