Fix processHeapClosureForDead CONSTR_NOCAF case:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>
Fri, 13 Apr 2018 15:31:56 +0000 (11:31 -0400)
committerBen Gamari <ben@smart-cactus.org>
Fri, 13 Apr 2018 15:33:09 +0000 (11:33 -0400)
CONSTR_NOCAF was introduced with 55d535da10d as a replacement for
CONSTR_STATIC and CONSTR_NOCAF_STATIC, however, as explained in Note
[static constructors], we copy CONSTR_NOCAFs (which can also be seen in
evacuate) during GC, and they can become dead, like other CONSTR_X_Ys.
processHeapClosureForDead is updated to reflect this.

Reviewers: bgamari, simonmar, erikd

Subscribers: thomie, carter

GHC Trac Issues: #7836

Differential Revision: https://phabricator.haskell.org/D4567

rts/LdvProfile.c

index 7899416..7cf9ceb 100644 (file)
@@ -101,6 +101,7 @@ processHeapClosureForDead( const StgClosure *c )
     case CONSTR_2_0:
     case CONSTR_1_1:
     case CONSTR_0_2:
+    case CONSTR_NOCAF:
     case FUN:
     case FUN_1_0:
     case FUN_0_1:
@@ -130,7 +131,6 @@ processHeapClosureForDead( const StgClosure *c )
     case IND_STATIC:
     case FUN_STATIC:
     case THUNK_STATIC:
-    case CONSTR_NOCAF:
         // stack objects
     case UPDATE_FRAME:
     case CATCH_FRAME:
@@ -139,6 +139,9 @@ processHeapClosureForDead( const StgClosure *c )
     case RET_BCO:
     case RET_SMALL:
     case RET_BIG:
+    case CATCH_STM_FRAME:
+    case CATCH_RETRY_FRAME:
+    case ATOMICALLY_FRAME:
         // others
     case INVALID_OBJECT:
     case COMPACT_NFDATA: