stack may be uncleared

parent 57e6a783
......@@ -441,7 +441,16 @@ mark_context_stack(mrb_state *mrb, struct mrb_context *c)
if (c->ci) e += c->ci->nregs;
if (c->stbase + e > c->stend) e = c->stend - c->stbase;
for (i=0; i<e; i++) {
mrb_gc_mark_value(mrb, c->stbase[i]);
mrb_value v = c->stbase[i];
if (!mrb_immediate_p(v)) {
if (mrb_basic_ptr(v)->tt == MRB_TT_FREE) {
c->stbase[i] = mrb_nil_value();
}
else {
mrb_gc_mark(mrb, mrb_basic_ptr(v));
}
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment