From 5913c5f8e45d667b26f85a4d66ef9b4fab4d54f4 Mon Sep 17 00:00:00 2001 From: atdt Date: Thu, 13 Dec 2018 17:20:06 -0800 Subject: [PATCH] Don't use _bzhi_u32 under MSan MSan knows that x & 0xFF only uses the lower byte from x but it isn't as smart about _bzhi_u32(val, 8). (I'll file an upstream bug.) --- snappy.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snappy.cc b/snappy.cc index 26bef54..67e8a79 100644 --- a/snappy.cc +++ b/snappy.cc @@ -695,7 +695,7 @@ static inline void Report(const char *algorithm, size_t compressed_size, static inline uint32 ExtractLowBytes(uint32 v, int n) { DCHECK_GE(n, 0); DCHECK_LE(n, 4); -#ifdef __BMI2__ +#if defined(__BMI2__) && !defined(MEMORY_SANITIZER) return _bzhi_u32(v, 8 * n); #else // This needs to be wider than uint32 otherwise `mask << 32` will be