diff --git a/clang/include/clang/Basic/Sanitizers.h b/clang/include/clang/Basic/Sanitizers.h index 5961abf2aa19..c6b0446cea4f 100644 --- a/clang/include/clang/Basic/Sanitizers.h +++ b/clang/include/clang/Basic/Sanitizers.h @@ -52,10 +52,11 @@ public: /// Create a mask with a bit enabled at position Pos. static constexpr SanitizerMask bitPosToMask(const unsigned Pos) { - return SanitizerMask((Pos < kNumBitElem) ? 1ULL << Pos % kNumBitElem : 0, - (Pos >= kNumBitElem && Pos < kNumBitElem * 2) - ? 1ULL << Pos % kNumBitElem - : 0); + uint64_t mask1 = (Pos < kNumBitElem) ? 1ULL << (Pos % kNumBitElem) : 0; + uint64_t mask2 = (Pos >= kNumBitElem && Pos < (kNumBitElem * 2)) + ? 1ULL << (Pos % kNumBitElem) + : 0; + return SanitizerMask(mask1, mask2); } unsigned countPopulation() const {