From 644ccfc9c78964490673a1b50c592a4da9e12a1b Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Mon, 14 Oct 2019 16:46:21 +0000 Subject: [PATCH] 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 --- lib/TableGen/Record.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 41c44280d83..835ef8c7141 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -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. -- 2.49.0