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