We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
envadjust
1 parent ad3b61f commit a1d32afCopy full SHA for a1d32af
src/vm.c
@@ -118,16 +118,16 @@ static inline void
118
envadjust(mrb_state *mrb, mrb_value *oldbase, mrb_value *newbase)
119
{
120
mrb_callinfo *ci = mrb->c->cibase;
121
+ ptrdiff_t off;
122
123
if (newbase == oldbase) return;
124
+ off = newbase - oldbase;
125
while (ci <= mrb->c->ci) {
126
struct REnv *e = ci->env;
127
if (e && MRB_ENV_STACK_SHARED_P(e)) {
- ptrdiff_t off = e->stack - oldbase;
-
128
- e->stack = newbase + off;
+ e->stack += off;
129
}
130
- ci->stackent = newbase + (ci->stackent - oldbase);
+ ci->stackent += off;
131
ci++;
132
133
0 commit comments