Commit 3c18ec27 authored by Takeshi Watanabe's avatar Takeshi Watanabe

Fix possible memory access error.

parent 6f1e1777
...@@ -658,7 +658,7 @@ gc_mark_children(mrb_state *mrb, mrb_gc *gc, struct RBasic *obj) ...@@ -658,7 +658,7 @@ gc_mark_children(mrb_state *mrb, mrb_gc *gc, struct RBasic *obj)
struct REnv *e = (struct REnv*)obj; struct REnv *e = (struct REnv*)obj;
mrb_int i, len; mrb_int i, len;
if (MRB_ENV_STACK_SHARED_P(e) && e->cxt->fib) { if (MRB_ENV_STACK_SHARED_P(e) && e->cxt && e->cxt->fib) {
mrb_gc_mark(mrb, (struct RBasic*)e->cxt->fib); mrb_gc_mark(mrb, (struct RBasic*)e->cxt->fib);
} }
len = MRB_ENV_STACK_LEN(e); len = MRB_ENV_STACK_LEN(e);
......
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