initialize ci->stackent at the top; #1691

This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-02-09 19:20:16 +09:00
parent ee0b7d150b
commit 00bdaec766
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -94,6 +94,7 @@ fiber_init(mrb_state *mrb, mrb_value self)
c->cibase = (mrb_callinfo *)mrb_calloc(mrb, FIBER_CI_INIT_SIZE, sizeof(mrb_callinfo));
c->ciend = c->cibase + FIBER_CI_INIT_SIZE;
c->ci = c->cibase;
c->ci->stackent = c->stack;
/* adjust return callinfo */
ci = c->ci;
+2
View File
@@ -109,6 +109,7 @@ stack_init(mrb_state *mrb)
c->ciend = c->cibase + CALLINFO_INIT_SIZE;
c->ci = c->cibase;
c->ci->target_class = mrb->object_class;
c->ci->stackent = c->stack;
}
static inline void
@@ -116,6 +117,7 @@ envadjust(mrb_state *mrb, mrb_value *oldbase, mrb_value *newbase)
{
mrb_callinfo *ci = mrb->c->cibase;
if (newbase == oldbase) return;
while (ci <= mrb->c->ci) {
struct REnv *e = ci->env;
if (e && e->cioff >= 0) {