Skip to content

Commit

Permalink
Revert "Simplify pointer calculation in envadjust."
Browse files Browse the repository at this point in the history
This reverts commit a1d32af.
  • Loading branch information
dabroz committed Apr 24, 2017
1 parent 6088276 commit b112046
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,16 @@ static inline void
envadjust(mrb_state *mrb, mrb_value *oldbase, mrb_value *newbase)
{
mrb_callinfo *ci = mrb->c->cibase;
ptrdiff_t off;

if (newbase == oldbase) return;
off = newbase - oldbase;
while (ci <= mrb->c->ci) {
struct REnv *e = ci->env;
if (e && MRB_ENV_STACK_SHARED_P(e)) {
e->stack += off;
ptrdiff_t off = e->stack - oldbase;

e->stack = newbase + off;
}
ci->stackent += off;
ci->stackent = newbase + (ci->stackent - oldbase);
ci++;
}
}
Expand Down

0 comments on commit b112046

Please sign in to comment.