summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libraries/base/Data/Bits.hs8
-rw-r--r--libraries/base/changelog.md3
2 files changed, 3 insertions, 8 deletions
diff --git a/libraries/base/Data/Bits.hs b/libraries/base/Data/Bits.hs
index 38025f877c..9134e13ba8 100644
--- a/libraries/base/Data/Bits.hs
+++ b/libraries/base/Data/Bits.hs
@@ -515,15 +515,7 @@ instance Bits Integer where
complement = complementInteger
shift x i@(I# i#) | i >= 0 = shiftLInteger x i#
| otherwise = shiftRInteger x (negateInt# i#)
- shiftL x i@(I# i#)
- | i < 0 = error "Bits.shiftL(Integer): negative shift"
- | otherwise = shiftLInteger x i#
- shiftR x i@(I# i#)
- | i < 0 = error "Bits.shiftR(Integer): negative shift"
- | otherwise = shiftRInteger x i#
-
testBit x (I# i) = testBitInteger x i
-
zeroBits = 0
#if HAVE_INTEGER_GMP1
diff --git a/libraries/base/changelog.md b/libraries/base/changelog.md
index 4874808d2d..7c4bf770f4 100644
--- a/libraries/base/changelog.md
+++ b/libraries/base/changelog.md
@@ -66,6 +66,9 @@
`GHC.Generics` as part of making GHC generics capable of handling
unlifted types (#10868)
+ * Keep `shift{L,R}` on `Integer` with negative shift-arguments from
+ segfaulting (#10571)
+
## 4.8.1.0 *Jul 2015*
* Bundled with GHC 7.10.2