[commit: ghc] wip/D4759: rts: Make LOOKS_LIKE_INFO_PTR a bit more strict (ed6aaaf)

git at git.haskell.org git at git.haskell.org
Sun Mar 31 15:09:13 UTC 2019


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

On branch  : wip/D4759
Link       : http://ghc.haskell.org/trac/ghc/changeset/ed6aaafcf644f804b108dbfd7924bf605f8c0f48/ghc

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

commit ed6aaafcf644f804b108dbfd7924bf605f8c0f48
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Sun Jan 20 20:34:52 2019 -0500

    rts: Make LOOKS_LIKE_INFO_PTR a bit more strict
    
    In particular, we now verify that the info table doesn't reside in the
    dynamic heap.
    
    Test Plan: Validate
    
    Previously Differential Revision https://phabricator.haskell.org/D4759


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

ed6aaafcf644f804b108dbfd7924bf605f8c0f48
 includes/Cmm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/includes/Cmm.h b/includes/Cmm.h
index 7334eab..9ae2be8 100644
--- a/includes/Cmm.h
+++ b/includes/Cmm.h
@@ -577,7 +577,7 @@
 
 /* Debugging macros */
 #define LOOKS_LIKE_INFO_PTR(p)                                  \
-   ((p) != NULL &&                                              \
+   (!HEAP_ALLOCED(p) &&                                         \
     LOOKS_LIKE_INFO_PTR_NOT_NULL(p))
 
 #define LOOKS_LIKE_INFO_PTR_NOT_NULL(p)                         \



More information about the ghc-commits mailing list