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.)
This commit is contained in:
atdt
2018-12-13 17:20:06 -08:00
committed by Victor Costan
parent 136b3ebc31
commit 5913c5f8e4

View File

@@ -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