diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-07-30 10:19:14 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-30 22:56:03 -0400 |
commit | 380638a33691ba43fdcd2e18bca636750e5f66f1 (patch) | |
tree | 6ff565e6f41f1e17583554a732db64beb1eaa8ec /libraries/ghc-bignum/src | |
parent | 175cb5b4044e6f4ad2224f54115f42e7a8b08f9b (diff) | |
download | haskell-380638a33691ba43fdcd2e18bca636750e5f66f1.tar.gz |
Bignum: fix powMod for gmp backend (#18515)
Also reenable integerPowMod test which had never been reenabled by
mistake.
Diffstat (limited to 'libraries/ghc-bignum/src')
-rw-r--r-- | libraries/ghc-bignum/src/GHC/Num/BigNat/GMP.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libraries/ghc-bignum/src/GHC/Num/BigNat/GMP.hs b/libraries/ghc-bignum/src/GHC/Num/BigNat/GMP.hs index cb1fe500d9..965b7c76ec 100644 --- a/libraries/ghc-bignum/src/GHC/Num/BigNat/GMP.hs +++ b/libraries/ghc-bignum/src/GHC/Num/BigNat/GMP.hs @@ -349,7 +349,8 @@ bignat_powmod -> State# RealWorld -> State# RealWorld bignat_powmod r b e m s = - ioVoid (integer_gmp_powm# r b (wordArraySize# b) e (wordArraySize# e) m (wordArraySize# m)) s + case ioInt# (integer_gmp_powm# r b (wordArraySize# b) e (wordArraySize# e) m (wordArraySize# m)) s of + (# s', n #) -> mwaSetSize# r (narrowGmpSize# n) s' ---------------------------------------------------------------------- |