forked from OSchip/llvm-project
SanitizerMask::bitPosToMask - fix operator precedence warnings. NFCI.
Fix static analyzer operator precedence warnings with suitable bracketing. Pull out the mask generation code so clang-format doesn't make such a mess of it.
This commit is contained in:
parent
03cde3a7cc
commit
a0324e9113
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue