aports/main/snappy/fix-GetHashTable.patch

17 lines
562 B
Diff

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_)) {