preserve only arguments on stack; fix #1527

parent c2ad0948
...@@ -595,7 +595,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self) ...@@ -595,7 +595,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
if (!mrb->c->stack) { if (!mrb->c->stack) {
stack_init(mrb); stack_init(mrb);
} }
stack_extend(mrb, irep->nregs, irep->nregs); stack_extend(mrb, irep->nregs, mrb->c->ci->argc + 2); /* argc + 2 (receiver and block) */
mrb->c->ci->err = pc; mrb->c->ci->err = pc;
mrb->c->ci->proc = proc; mrb->c->ci->proc = proc;
mrb->c->ci->nregs = irep->nregs + 1; mrb->c->ci->nregs = irep->nregs + 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment