summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-08-29 14:12:12 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2020-08-29 14:15:55 +0100
commit8e83b7e39bbc510a81c477d4dfa95adf1b7240ae (patch)
tree1fb889143d10fa3ef09d33861667d7e382537eaf /dev-haskell/encoding/files
parentx11-libs/libX11: Stabilize 1.6.12 ppc, #738984 (diff)
downloadgentoo-8e83b7e39bbc510a81c477d4dfa95adf1b7240ae.tar.gz
gentoo-8e83b7e39bbc510a81c477d4dfa95adf1b7240ae.tar.bz2
gentoo-8e83b7e39bbc510a81c477d4dfa95adf1b7240ae.zip
dev-haskell/encoding: bump up to 0.8.5
Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'dev-haskell/encoding/files')
-rw-r--r--dev-haskell/encoding/files/encoding-0.8.2-overflow.patch41
1 files changed, 41 insertions, 0 deletions
diff --git a/dev-haskell/encoding/files/encoding-0.8.2-overflow.patch b/dev-haskell/encoding/files/encoding-0.8.2-overflow.patch
new file mode 100644
index 000000000000..c8085c827197
--- /dev/null
+++ b/dev-haskell/encoding/files/encoding-0.8.2-overflow.patch
@@ -0,0 +1,41 @@
+https://github.com/dmwit/encoding/pull/11
+
+From ce27249d4260c7eb3f514c95d5edd762804dd4f3 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@gentoo.org>
+Date: Sat, 29 Aug 2020 13:52:33 +0100
+Subject: [PATCH] Data/Map/Static/Builder.hs: avoid shiftL with negative offset
+
+On ghc-8.8 building `encoding` fails as:
+
+```
+Preprocessing library for encoding-0.8.5..
+arithmetic overflow
+```
+
+This happens because `findSplitSize` can't handle
+small values, like `findSplitSize 1` and calls `shiftL`
+with negative value, which is forbdden:
+ https://hackage.haskell.org/package/base-4.14.0.0/docs/Data-Bits.html#v:shiftL
+
+Work it around by always passing non-negative offset.
+
+Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
+---
+ Data/Map/Static/Builder.hs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Data/Map/Static/Builder.hs b/Data/Map/Static/Builder.hs
+index 486e19c..61851cd 100644
+--- a/Data/Map/Static/Builder.hs
++++ b/Data/Map/Static/Builder.hs
+@@ -37,6 +37,6 @@ treeDepth sz = find' [0..]
+ findSplitSize :: Int -> Int
+ findSplitSize len = let depth = treeDepth len
+ free = (maxSize depth) - len
+- in if free <= (1 `shiftL` (depth - 2))
++ in if 2 * free <= (1 `shiftL` (depth - 1))
+ then maxSize (depth - 1)
+ else len - (maxSize (depth - 2)) - 1
+--
+2.28.0
+