[commit: ghc] master: isAlive needs to look through BLACKHOLE indirections (9b6e931)

Simon Marlow marlowsd at gmail.com
Thu Feb 14 14:35:50 CET 2013


Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/9b6e931574992913fbb6a5e537abdb088c3da4f2

>---------------------------------------------------------------

commit 9b6e931574992913fbb6a5e537abdb088c3da4f2
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Thu Feb 14 13:09:09 2013 +0000

    isAlive needs to look through BLACKHOLE indirections
    
    This has been breaking StableNames and possibly weak pointers in some
    cases.

>---------------------------------------------------------------

 rts/sm/GCAux.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c
index 3df36d7..29c1e9d 100644
--- a/rts/sm/GCAux.c
+++ b/rts/sm/GCAux.c
@@ -93,6 +93,14 @@ isAlive(StgClosure *p)
       p = ((StgInd *)q)->indirectee;
       continue;
 
+    case BLACKHOLE:
+        p = ((StgInd*)q)->indirectee;
+        if (GET_CLOSURE_TAG(p) != 0) {
+            continue;
+        } else {
+            return NULL;
+        }
+
     default:
       // dead. 
       return NULL;





More information about the ghc-commits mailing list