[commit: ghc] ghc-8.0: Fix LOOKS_LIKE_PTR for 64-bit platforms (63de06a)

git at git.haskell.org git at git.haskell.org
Tue Feb 2 09:47:30 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/63de06a1a0f237aebf457fae97e8eb7e82933bec/ghc

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

commit 63de06a1a0f237aebf457fae97e8eb7e82933bec
Author: Reid Barton <rwbarton at gmail.com>
Date:   Mon Feb 1 14:32:38 2016 +0100

    Fix LOOKS_LIKE_PTR for 64-bit platforms
    
    I'm not sure what this is used for. But it won't correctly
    detect RTS-filled slop on 64-bit platforms.
    
    Test Plan:
    Untested. But I did verify that
    
        unsigned long x = (unsigned long)0xaaaaaaaaaaaaaaaaULL;
    
    compiles warning-free and produces the expected output using both
    gcc and clang, with -Wall -Wextra -O, and with and without -m32.
    
    Reviewers: simonmar, austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D1860
    
    (cherry picked from commit ba88aab0d1223cd5066a66500360df4bddb159d1)


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

63de06a1a0f237aebf457fae97e8eb7e82933bec
 rts/RetainerProfile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c
index ba58c19..387c6d7 100644
--- a/rts/RetainerProfile.c
+++ b/rts/RetainerProfile.c
@@ -2066,7 +2066,7 @@ retainerProfile(void)
 
 #define LOOKS_LIKE_PTR(r) ((LOOKS_LIKE_STATIC_CLOSURE(r) || \
         ((HEAP_ALLOCED(r) && ((Bdescr((P_)r)->flags & BF_FREE) == 0)))) && \
-        ((StgWord)(*(StgPtr)r)!=0xaaaaaaaa))
+        ((StgWord)(*(StgPtr)r)!=(StgWord)0xaaaaaaaaaaaaaaaaULL))
 
 static nat
 sanityCheckHeapClosure( StgClosure *c )



More information about the ghc-commits mailing list