From fc162302ef6c68e49a9ff75d0fa8998e115e3f45 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 20 Aug 2010 02:57:01 +0000 Subject: [PATCH] Fix bug in the GC's ephemeron scanning. When queueing ephemerons for the key stored at some address, compare the address to the weak referent address of each ephemeron's key -- not to the object address of each ephemeron's key, which causes us to miss ephemerons whose keys are compiled entries, because we pass the addresses of compiled blocks, never those of the compiled entries stored in them, to queue_ephemerons_for_key. --- src/microcode/gcloop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/microcode/gcloop.c b/src/microcode/gcloop.c index 695c774e3..52c02189a 100644 --- a/src/microcode/gcloop.c +++ b/src/microcode/gcloop.c @@ -850,7 +850,9 @@ queue_ephemerons_for_key (SCHEME_OBJECT * addr) SCHEME_OBJECT * entry_addr = (OBJECT_ADDRESS (entry)); SCHEME_OBJECT * next_loc = (NEWSPACE_TO_TOSPACE (entry_addr + EPHEMERON_NEXT)); - if (addr == (OBJECT_ADDRESS (READ_TOSPACE (entry_addr + EPHEMERON_KEY)))) + SCHEME_OBJECT * key_addr + = (weak_referent_address (READ_TOSPACE (entry_addr + EPHEMERON_KEY))); + if (addr == key_addr) { (*entry_loc) = (*next_loc); (*next_loc) = ephemeron_queue; -- 2.25.1