Need to mark fibers referenced from env; fix #3837

The issue #3837 is a regression of #3819. I was mistakenly removed
a important code to mark fibers from `env`.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-10-31 09:06:04 +09:00
parent 77edafb04c
commit b6598e052f
2 changed files with 3 additions and 1 deletions
-1
View File
@@ -19,7 +19,6 @@ struct REnv {
MRB_OBJECT_HEADER;
mrb_value *stack;
struct mrb_context *cxt;
// struct RProc *proc;
mrb_sym mid;
};
+3
View File
@@ -657,6 +657,9 @@ gc_mark_children(mrb_state *mrb, mrb_gc *gc, struct RBasic *obj)
struct REnv *e = (struct REnv*)obj;
mrb_int i, len;
if (MRB_ENV_STACK_SHARED_P(e) && e->cxt->fib) {
mrb_gc_mark(mrb, (struct RBasic*)e->cxt->fib);
}
len = MRB_ENV_STACK_LEN(e);
for (i=0; i<len; i++) {
mrb_gc_mark_value(mrb, e->stack[i]);