Ensure size of the stack in OP_CALL.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-06-15 13:36:36 +09:00
parent bb1bfaa2fb
commit af6041f1d0
+1 -2
View File
@@ -1434,14 +1434,13 @@ RETRY_TRY_BLOCK:
pool = irep->pool;
syms = irep->syms;
ci->nregs = irep->nregs;
stack_extend(mrb, irep->nregs);
if (ci->argc < 0) {
if (irep->nregs > 3) {
stack_extend(mrb, irep->nregs);
stack_clear(regs+3, irep->nregs-3);
}
}
else if (ci->argc+2 < irep->nregs) {
stack_extend(mrb, irep->nregs);
stack_clear(regs+ci->argc+2, irep->nregs-ci->argc-2);
}
if (m->env) {