Permalink
Browse files

Update stack only when callinfo is popped; fix #3521

  • Loading branch information...
matz committed Mar 18, 2017
1 parent 6db38c3 commit 75c374cad330e2c99ceb7e1ca083523a7651e753
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/vm.c
View
@@ -1642,12 +1642,12 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
CASE(OP_RETURN) {
/* A B return R(A) (B=normal,in-block return/break) */
if (mrb->exc) {
mrb_callinfo *ci;
mrb_callinfo *ci, *ci0;
mrb_value *stk;
int eidx;
L_RAISE:
ci = mrb->c->ci;
ci0 = ci = mrb->c->ci;
mrb_obj_iv_ifnone(mrb, mrb->exc, mrb_intern_lit(mrb, "lastpc"), mrb_cptr_value(mrb, pc));
mrb_obj_iv_ifnone(mrb, mrb->exc, mrb_intern_lit(mrb, "ciidx"), mrb_fixnum_value(ci - mrb->c->cibase));
eidx = ci->eidx;
@@ -1694,7 +1694,9 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
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;
}
pc = mrb->c->rescue[--ci->ridx];
}
else {

0 comments on commit 75c374c

Please sign in to comment.