Skip to content

Commit

Permalink
Call envadjust() before updating VM stack.
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Apr 18, 2017
1 parent ae4217e commit 79e0314
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,10 @@ stack_extend_alloc(mrb_state *mrb, int room)
mrb_exc_raise(mrb, mrb_obj_value(mrb->stack_err));
}
stack_clear(&(newstack[oldsize]), size - oldsize);
envadjust(mrb, oldbase, newstack);
mrb->c->stbase = newstack;
mrb->c->stack = mrb->c->stbase + off;
mrb->c->stend = mrb->c->stbase + size;
envadjust(mrb, oldbase, mrb->c->stbase);

/* Raise an exception if the new stack size will be too large,
to prevent infinite recursion. However, do this only after resizing the stack, so mrb_raise has stack space to work with. */
Expand Down

0 comments on commit 79e0314

Please sign in to comment.