Permalink
Browse files

Should not shrink VM stack; fix #3551

  • Loading branch information...
matz committed Apr 1, 2017
1 parent 56322cd commit 071164b7999d0932fd60fb3c580a6c374ab1cf4f
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/vm.c
View
@@ -1202,7 +1202,8 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
else {
mrb_value blk = regs[bidx];
if (!mrb_nil_p(blk) && mrb_type(blk) != MRB_TT_PROC) {
mrb->c->ci->nregs = bidx+1;
if(bidx >= mrb->c->ci->nregs)
mrb->c->ci->nregs = bidx+1;
regs[bidx] = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
}
}
@@ -1438,7 +1439,8 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
}
blk = regs[bidx];
if (!mrb_nil_p(blk) && mrb_type(blk) != MRB_TT_PROC) {
ci->nregs = bidx+1;
if(bidx >= ci->nregs)
ci->nregs = bidx+1;
regs[bidx] = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
ci = mrb->c->ci;
}

0 comments on commit 071164b

Please sign in to comment.