Permalink
Browse files

Avoid marking possibly freed stack; #3550 #3612

  • Loading branch information...
matz committed May 25, 2017
1 parent c53747d commit de48d95c6d0336f4b91bd18adf0a5c4a4ec0a538
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/gc.c
View
@@ -648,8 +648,11 @@ 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.c->fib) {
mrb_gc_mark(mrb, (struct RBasic*)e->cxt.c->fib);
if (MRB_ENV_STACK_SHARED_P(e)) {
if (e->cxt.c->fib) {
mrb_gc_mark(mrb, (struct RBasic*)e->cxt.c->fib);
}
break;
}
len = MRB_ENV_STACK_LEN(e);
for (i=0; i<len; i++) {

0 comments on commit de48d95

Please sign in to comment.