Skip to content

Commit

Permalink
Revert 01f7825; fix #3650
Browse files Browse the repository at this point in the history
Redundant `mark_context() is far better than crashes.
  • Loading branch information
matz committed May 25, 2017
1 parent ac442bc commit f75f506
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,8 @@ mark_context(mrb_state *mrb, struct mrb_context *c)
}
/* mark fibers */
mrb_gc_mark(mrb, (struct RBasic*)c->fib);
if (c->prev && c->prev->fib) {
mrb_gc_mark(mrb, (struct RBasic*)c->prev->fib);
if (c->prev) {
mark_context(mrb, c->prev);
}
}

Expand Down Expand Up @@ -878,9 +878,9 @@ root_scan_phase(mrb_state *mrb, mrb_gc *gc)
mrb_gc_mark(mrb, (struct RBasic*)mrb->arena_err);
#endif

mark_context(mrb, mrb->root_c);
mark_context(mrb, mrb->c);
if (mrb->root_c != mrb->c) {
mark_context(mrb, mrb->c);
mark_context(mrb, mrb->root_c);
}
}

Expand Down

0 comments on commit f75f506

Please sign in to comment.