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

git at git.haskell.org git at git.haskell.org
Mon Jan 21 01:36:27 UTC 2019


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

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

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

commit b86afeb8d30a9dac8919619486c940345d89941c
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


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

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

diff --git a/includes/Cmm.h b/includes/Cmm.h
index 7334eab..21093eb 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