Permalink
Browse files

Ensure size of the stack in OP_CALL.

  • Loading branch information...
matz committed Jun 15, 2017
1 parent bb1bfaa commit af6041f1d09fc39b65c66ecc87fc63b9caead280
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/vm.c
View
@@ -1434,14 +1434,13 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
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) {

0 comments on commit af6041f

Please sign in to comment.