fix gc bug: ci->env and env-up are nullable
This commit is contained in:
parent
787dae1fe5
commit
35bbd66812
8
src/gc.c
8
src/gc.c
|
@ -162,7 +162,9 @@ gc_mark_object(pic_state *pic, struct pic_object *obj)
|
|||
for (i = 0; i < env->num_val; ++i) {
|
||||
gc_mark(pic, env->values[i]);
|
||||
}
|
||||
gc_mark_object(pic, (struct pic_object *)env->up);
|
||||
if (env->up) {
|
||||
gc_mark_object(pic, (struct pic_object *)env->up);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PIC_TT_PROC: {
|
||||
|
@ -222,7 +224,9 @@ gc_mark_phase(pic_state *pic)
|
|||
|
||||
/* callinfo */
|
||||
for (ci = pic->ci; ci != pic->cibase; --ci) {
|
||||
gc_mark_object(pic, (struct pic_object *)ci->env);
|
||||
if (ci->env) {
|
||||
gc_mark_object(pic, (struct pic_object *)ci->env);
|
||||
}
|
||||
}
|
||||
|
||||
/* arena */
|
||||
|
|
Loading…
Reference in New Issue