summaryrefslogtreecommitdiff
path: root/libraries/ghc-heap/tests/heap_all.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2023-03-27 13:00:49 +0200
committerMatthew Pickering <matthewtpickering@gmail.com>2023-03-30 10:02:27 +0100
commit6e11395a774f0fd1ab4b33f145ce6aeadcdddeaf (patch)
tree00115a1c7bbe1c3aacee9bcd383213df2a9d0c61 /libraries/ghc-heap/tests/heap_all.hs
parent98b5cf67f8428b0daefcbf5df121df0b8a126654 (diff)
downloadhaskell-wip/23181-2.tar.gz
ghc-heap: remove wrong Addr# coercion (#23181)wip/23181-2
Conversion from Addr# to I# isn't correct with the JS backend.
Diffstat (limited to 'libraries/ghc-heap/tests/heap_all.hs')
-rw-r--r--libraries/ghc-heap/tests/heap_all.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/libraries/ghc-heap/tests/heap_all.hs b/libraries/ghc-heap/tests/heap_all.hs
index ac8953b5d2..482b424283 100644
--- a/libraries/ghc-heap/tests/heap_all.hs
+++ b/libraries/ghc-heap/tests/heap_all.hs
@@ -12,6 +12,7 @@ import GHC.Int
import GHC.IO
import GHC.IORef
import GHC.MVar
+import GHC.Ptr
import GHC.Stack
import GHC.STRef
import GHC.Weak
@@ -176,7 +177,7 @@ exWord64Closure = Word64Closure
exAddrClosure :: Closure
exAddrClosure = AddrClosure
- { ptipe = PAddr, addrVal = 42 }
+ { ptipe = PAddr, addrVal = nullPtr `plusPtr` 42 }
exFloatClosure :: Closure
exFloatClosure = FloatClosure
@@ -328,7 +329,7 @@ main = do
-- assertClosuresEq exWord64Closure
-- Primitive Addr
- let v = unsafeCoerce# 42# :: Addr#
+ let (Ptr v) = nullPtr `plusPtr` 42
getClosureData v >>=
assertClosuresEq exAddrClosure