Fix possible memory access error.

This commit is contained in:
Takeshi Watanabe
2018-02-02 13:30:32 +09:00
parent 6f1e1777cb
commit 3c18ec27e9
+1 -1
View File
@@ -658,7 +658,7 @@ 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) {
if (MRB_ENV_STACK_SHARED_P(e) && e->cxt && e->cxt->fib) {
mrb_gc_mark(mrb, (struct RBasic*)e->cxt->fib);
}
len = MRB_ENV_STACK_LEN(e);