Commit 07b3be76 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

integer-gmp: Fix #11296

This was introduced by a mental fumble in
9e8562ae 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
parent 11778f74
......@@ -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'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment