Calling reset() on an empty BitVector would call memset with a nullptr
argument which is undefined behaviour.
This should fix the sanitizer bot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292575
91177308-0d34-0410-b5e6-
96231b3b80d8
}
void init_words(BitWord *B, unsigned NumWords, bool t) {
- memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
+ if (NumWords > 0)
+ memset(B, 0 - (int)t, NumWords*sizeof(BitWord));
}
template<bool AddBits, bool InvertMask>