[commit: ghc] master: Fix minusNatural exception to be Underflow (18cdef3)
git at git.haskell.org
git at git.haskell.org
Sat Feb 4 23:08:31 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/18cdef385d432efc57bbda3818265e0fde41e701/ghc
>---------------------------------------------------------------
commit 18cdef385d432efc57bbda3818265e0fde41e701
Author: Oleg Grenrus <oleg.grenrus at iki.fi>
Date: Fri Feb 3 13:52:25 2017 +0200
Fix minusNatural exception to be Underflow
>---------------------------------------------------------------
18cdef385d432efc57bbda3818265e0fde41e701
libraries/base/GHC/Natural.hs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libraries/base/GHC/Natural.hs b/libraries/base/GHC/Natural.hs
index 9bca0a2..0e5abc7 100644
--- a/libraries/base/GHC/Natural.hs
+++ b/libraries/base/GHC/Natural.hs
@@ -399,8 +399,8 @@ minusNatural :: Natural -> Natural -> Natural
minusNatural x (NatS# 0##) = x
minusNatural (NatS# x) (NatS# y) = case subWordC# x y of
(# l, 0# #) -> NatS# l
- _ -> divZeroError -- underflowException
-minusNatural (NatS# _) (NatJ# _) = divZeroError -- underflowException
+ _ -> underflowError
+minusNatural (NatS# _) (NatJ# _) = underflowError
minusNatural (NatJ# x) (NatS# y)
= bigNatToNatural $ minusBigNatWord x y
minusNatural (NatJ# x) (NatJ# y)
More information about the ghc-commits
mailing list