nregs size was too big (off by one); close #1137

parent 5dea19e9
......@@ -403,7 +403,7 @@ mrb_yield_internal(mrb_state *mrb, mrb_value b, int argc, mrb_value *argv, mrb_v
ci->nregs = argc + 2;
}
else {
ci->nregs = p->body.irep->nregs + 2;
ci->nregs = p->body.irep->nregs + 1;
}
ci->acc = -1;
mrb->stack = mrb->stack + n;
......@@ -568,7 +568,7 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
}
stack_extend(mrb, irep->nregs, irep->nregs);
mrb->ci->proc = proc;
mrb->ci->nregs = irep->nregs + 2;
mrb->ci->nregs = irep->nregs + 1;
regs = mrb->stack;
regs[0] = self;
......
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