CheckUnload needs to look at revertible_caf_list
authorSimon Marlow <marlowsd@gmail.com>
Thu, 21 Nov 2013 12:25:30 +0000 (12:25 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 21 Nov 2013 13:27:34 +0000 (13:27 +0000)
Retained CAFs must keep an object file alive.

rts/CheckUnload.c

index d3fb893..8692dea 100644 (file)
@@ -267,6 +267,13 @@ void checkUnload (StgClosure *static_objects)
       link = *STATIC_LINK(info, p);
   }
 
+  // CAFs on revertible_caf_list are not on static_objects
+  for (p = (StgClosure*)revertible_caf_list;
+       p != END_OF_STATIC_LIST;
+       p = ((StgIndStatic *)p)->static_link) {
+      checkAddress(addrs, p);
+  }
+
   for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
       searchHeapBlocks (addrs, generations[g].blocks);
       searchHeapBlocks (addrs, generations[g].large_objects);