From: Taylor R Campbell Date: Fri, 20 Aug 2010 02:57:01 +0000 (+0000) Subject: Fix bug in the GC's ephemeron scanning. X-Git-Tag: 20101212-Gtk~89 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=fc162302ef6c68e49a9ff75d0fa8998e115e3f45;p=mit-scheme.git 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. --- 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;