fix gc bug

This commit is contained in:
Yuichi Nishiwaki 2013-10-16 09:21:13 +09:00
parent 36b455d9c2
commit 1fc4ef18d1
1 changed files with 4 additions and 1 deletions

View File

@ -230,7 +230,7 @@ gc_sweep_phase(pic_state *pic)
#endif #endif
base = pic->heap->base; base = pic->heap->base;
for (p = base->s.ptr; p != base; p = p->s.ptr) { for (p = base->s.ptr; ; p = p->s.ptr) {
#if GC_DEBUG #if GC_DEBUG
puts("sweeping block"); puts("sweeping block");
@ -283,6 +283,9 @@ gc_sweep_phase(pic_state *pic)
goto retry; goto retry;
} }
if (p->s.ptr == base)
break;
} }
} }