BitsInit::resolveReferences - silence static analyzer null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, assert to check that the loop has set the cached pointer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374789 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Simon Pilgrim 2019-10-14 16:46:21 +00:00
parent dd72464f64
commit 644ccfc9c7

View File

@ -438,7 +438,7 @@ Init *BitsInit::resolveReferences(Resolver &R) const {
CachedBitVarRef = CurBitVar->getBitVar();
CachedBitVarResolved = CachedBitVarRef->resolveReferences(R);
}
assert(CachedBitVarResolved && "Unresolved bitvar reference");
NewBit = CachedBitVarResolved->getBit(CurBitVar->getBitNum());
} else {
// getBit(0) implicitly converts int and bits<1> values to bit.