aboutsummaryrefslogtreecommitdiffstats
path: root/main/snappy/fix-GetHashTable.patch
blob: 0fdf88e4723e62621796775d0157632d80f9a553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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_)) {