summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libraries/base/GHC/Word.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/base/GHC/Word.hs b/libraries/base/GHC/Word.hs
index 3419a24d58..47710118b5 100644
--- a/libraries/base/GHC/Word.hs
+++ b/libraries/base/GHC/Word.hs
@@ -304,7 +304,7 @@ instance FiniteBits Word16 where
finiteBitSize _ = 16
byteSwap16 :: Word16 -> Word16
-byteSwap16 (W16# w#) = W16# (byteSwap16# w#)
+byteSwap16 (W16# w#) = W16# (narrow16Word# (byteSwap16# w#))
{-# RULES
"fromIntegral/Word8->Word16" fromIntegral = \(W8# x#) -> W16# x#
@@ -531,7 +531,7 @@ instance Read Word32 where
#endif
byteSwap32 :: Word32 -> Word32
-byteSwap32 (W32# w#) = W32# (byteSwap32# w#)
+byteSwap32 (W32# w#) = W32# (narrow32Word# (byteSwap32# w#))
------------------------------------------------------------------------
-- type Word64