summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-06-19 14:35:21 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-27 11:55:59 -0400
commita403eb917bd26caf96c29d67bfe91163b593b2c9 (patch)
tree139bf73659806d5bbf2fd9c07eea753821c24cf8
parentce987865d7594ecbcb3d27435eef773e95b2db85 (diff)
downloadhaskell-a403eb917bd26caf96c29d67bfe91163b593b2c9.tar.gz
ghc-bignum: fix division by zero (#18359)
-rw-r--r--libraries/ghc-bignum/src/GHC/Num/BigNat.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/libraries/ghc-bignum/src/GHC/Num/BigNat.hs b/libraries/ghc-bignum/src/GHC/Num/BigNat.hs
index 5d0a9919f5..156a76d9ed 100644
--- a/libraries/ghc-bignum/src/GHC/Num/BigNat.hs
+++ b/libraries/ghc-bignum/src/GHC/Num/BigNat.hs
@@ -531,7 +531,7 @@ bigNatQuotWord a (W# b) = bigNatQuotWord# a b
-- b /= 0
bigNatRemWord# :: BigNat -> Word# -> Word#
bigNatRemWord# a b
- | 0## <- b = 1## `remWord#` 0##
+ | 0## <- b = case divByZero of _ -> 0##
| 1## <- b = 0##
| bigNatIsZero a = 0##
| True = inline bignat_rem_word a b