aboutsummaryrefslogtreecommitdiffstats
path: root/main/snappy/fix-GetHashTable.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/snappy/fix-GetHashTable.patch')
-rw-r--r--main/snappy/fix-GetHashTable.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/main/snappy/fix-GetHashTable.patch b/main/snappy/fix-GetHashTable.patch
new file mode 100644
index 0000000000..0fdf88e472
--- /dev/null
+++ b/main/snappy/fix-GetHashTable.patch
@@ -0,0 +1,16 @@
+Fix for armhf.
+
+See: https://groups.google.com/d/msg/snappy-compression/uhELq553TrI/J34d3D8_BwAJ
+ https://bugs.alpinelinux.org/issues/8921
+
+--- a/snappy.cc
++++ b/snappy.cc
+@@ -323,7 +323,7 @@
+ *table_size = 256;
+ } else {
+ // Since table size must be a power of 2, round up to the next power of 2.
+- *table_size = 1 << (std::numeric_limits<size_t>::digits -
++ *table_size = 1 << std::max(1, std::numeric_limits<size_t>::digits -
+ __builtin_clzll(input_size - 1));
+ }
+ if (*table_size <= ARRAYSIZE(small_table_)) {