Fix bug in the GC's ephemeron scanning.
authorTaylor R Campbell <campbell@mumble.net>
Fri, 20 Aug 2010 02:57:01 +0000 (02:57 +0000)
committerTaylor R Campbell <campbell@mumble.net>
Fri, 20 Aug 2010 02:57:01 +0000 (02:57 +0000)
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

index 695c774e3c0c8ea17f48f5ccb9ba1f23a8ef91ff..52c02189aa7a2e5c8730f8c1de19f42ab9999f7a 100644 (file)
@@ -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;