summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2015-12-27 17:49:10 +0100
committerBen Gamari <ben@smart-cactus.org>2015-12-27 18:47:54 +0100
commit07b3be76a14a061a43846ef41f1dd7819603be4e (patch)
tree9608bc8de0d324181ff70fd0a892cedf6a3182b3
parent11778f74da669b13e3748191e89e3c3cafed903b (diff)
downloadhaskell-07b3be76a14a061a43846ef41f1dd7819603be4e.tar.gz
integer-gmp: Fix #11296
This was introduced by a mental fumble in 9e8562ae02701270e2c1dfcee3279d862dc5b7b6 wherein I replaced `getSizeofMutableByteArray` with `getSizeofMutBigNat`. This was noticed by invalid integers being produced on 32-bit machines in #11296. Test Plan: Validate Reviewers: hvr, goldfire, austin Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1707 GHC Trac Issues: #11296
-rw-r--r--libraries/integer-gmp/src/GHC/Integer/Type.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/integer-gmp/src/GHC/Integer/Type.hs b/libraries/integer-gmp/src/GHC/Integer/Type.hs
index 167492d34d..3e563dc5a5 100644
--- a/libraries/integer-gmp/src/GHC/Integer/Type.hs
+++ b/libraries/integer-gmp/src/GHC/Integer/Type.hs
@@ -1659,7 +1659,7 @@ resizeMutBigNat# (MBN# mba0#) nsz# s
(# s'', mba# #) -> (# s'', MBN# mba# #)
where
bsz# = nsz# `uncheckedIShiftL#` GMP_LIMB_SHIFT#
- (# s', n# #) = getSizeofMutBigNat# (MBN# mba0#) s
+ (# s', n# #) = getSizeofMutableByteArray# mba0# s
shrinkMutBigNat# :: MutBigNat s -> GmpSize# -> State# s -> State# s
shrinkMutBigNat# (MBN# mba0#) nsz# s
@@ -1667,7 +1667,7 @@ shrinkMutBigNat# (MBN# mba0#) nsz# s
| True = shrinkMutableByteArray# mba0# bsz# s'
where
bsz# = nsz# `uncheckedIShiftL#` GMP_LIMB_SHIFT#
- (# s', n# #) = getSizeofMutBigNat# (MBN# mba0#) s
+ (# s', n# #) = getSizeofMutableByteArray# mba0# s
unsafeSnocFreezeBigNat# :: MutBigNat s -> GmpLimb# -> S s BigNat
unsafeSnocFreezeBigNat# mbn0@(MBN# mba0#) limb# s = go s'