From 528c2e2c15c5145b3aa6b3a2d16e10bcfba1ebea Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 15 Oct 2013 08:58:23 +0900 Subject: [PATCH] bugfix around GC --- src/gc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gc.c b/src/gc.c index adda3142..f650bbb0 100644 --- a/src/gc.c +++ b/src/gc.c @@ -231,6 +231,8 @@ gc_sweep_phase(pic_state *pic) puts("sweeping block"); #endif + retry: + for (bp = p + p->s.size; bp != p->s.ptr; bp += bp->s.size) { #if GC_DEBUG @@ -270,8 +272,11 @@ gc_sweep_phase(pic_state *pic) } else { p->s.ptr = bp; + /* retry with next p */ + p = p->s.ptr; } - break; + + goto retry; } } }