Permalink
Browse files

Call `stack_clear()` after `stack_extend()`; fix #3682

  • Loading branch information...
matz committed Jun 1, 2017
1 parent eb5a606 commit 87cc0344cde0e3ccafa162bdbcf8a6ffac61e6ba
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/vm.c
View
@@ -853,10 +853,10 @@ mrb_vm_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int stac
}
if (stack_keep > nregs)
nregs = stack_keep;
stack_extend(mrb, nregs);
if (nregs > stack_keep) {
stack_clear(c->stack + stack_keep, nregs - stack_keep);
}
stack_extend(mrb, nregs);
c->stack[0] = self;
result = mrb_vm_exec(mrb, proc, irep->iseq);
if (c->ci - c->cibase > cioff) {

0 comments on commit 87cc034

Please sign in to comment.