summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/StaticPtr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/StaticPtr.hs')
-rw-r--r--libraries/base/GHC/StaticPtr.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/libraries/base/GHC/StaticPtr.hs b/libraries/base/GHC/StaticPtr.hs
index ee5ba786f6..b8d5c116d1 100644
--- a/libraries/base/GHC/StaticPtr.hs
+++ b/libraries/base/GHC/StaticPtr.hs
@@ -48,7 +48,7 @@ module GHC.StaticPtr
) where
import Foreign.C.Types (CInt(..))
-import Foreign.Marshal (allocaArray, peekArray)
+import Foreign.Marshal (allocaArray, peekArray, withArray)
import GHC.Ptr (Ptr(..), nullPtr)
import GHC.Fingerprint (Fingerprint(..))
import GHC.Prim
@@ -87,13 +87,13 @@ staticKey (StaticPtr w0 w1 _ _) = Fingerprint (W64# w0) (W64# w1)
--
unsafeLookupStaticPtr :: StaticKey -> IO (Maybe (StaticPtr a))
unsafeLookupStaticPtr (Fingerprint w1 w2) = do
- ptr@(Ptr addr) <- hs_spt_lookup w1 w2
+ ptr@(Ptr addr) <- withArray [w1, w2] hs_spt_lookup
if (ptr == nullPtr)
then return Nothing
else case addrToAny# addr of
(# spe #) -> return (Just spe)
-foreign import ccall unsafe hs_spt_lookup :: Word64 -> Word64 -> IO (Ptr a)
+foreign import ccall unsafe hs_spt_lookup :: Ptr Word64 -> IO (Ptr a)
-- | A class for things buildable from static pointers.
class IsStatic p where