From eae7c5d5d7f0413b59b35f1e31e8f019336cfcd1 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 16 Nov 2011 20:23:25 -0700 Subject: [PATCH] fix place-GC problem with empty_self_modidx's shift cache --- src/racket/gc2/newgc.c | 18 ++++++++++++++++++ src/racket/src/module.c | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/racket/gc2/newgc.c b/src/racket/gc2/newgc.c index 8d6b3792a4..77d704a43c 100644 --- a/src/racket/gc2/newgc.c +++ b/src/racket/gc2/newgc.c @@ -2987,6 +2987,24 @@ void GC_mark2(const void *const_p, struct NewGC *gc) } } +#if 0 + if (page->size_class < 2) { + if (page->page_type == PAGE_TAGGED) { + void *q; + if (page->size_class) + q = MED_OBJHEAD(p, page->size) + 1; + else + q = p; + if (((objhead *)q)[-1].type == PAGE_TAGGED) { + if (!((objhead *)q)[-1].moved) { + if ((*(short *)q < 0) || (*(short *)q > 1000)) + abort(); + } + } + } + } +#endif + #ifdef NEWGC_BTC_ACCOUNT /* toss this over to the BTC mark routine if we're doing accounting */ if(gc->doing_memory_accounting) { diff --git a/src/racket/src/module.c b/src/racket/src/module.c index a8884b112d..53f203dd55 100644 --- a/src/racket/src/module.c +++ b/src/racket/src/module.c @@ -3435,7 +3435,8 @@ static Scheme_Object *do_modidx_shift(Scheme_Object *modidx, i = 0; } else { /* May have GCed: */ - if (cvec && !sbm->shift_cache) + if (cvec && !sbm->shift_cache + && !SAME_OBJ((Scheme_Object *)sbm, empty_self_modidx)) sbm->shift_cache = cvec; if (i >= c) {