[COFF] Silence static analyzer null dereference warning. NFCI.

Assert that the COFFSymbolRef is correct.

llvm-svn: 372757
This commit is contained in:
Simon Pilgrim 2019-09-24 13:57:38 +00:00
parent 66d4b83781
commit 4ee2d5a84e

View File

@ -314,7 +314,10 @@ public:
return CS16 ? CS16->Name.Offset : CS32->Name.Offset;
}
uint32_t getValue() const { return CS16 ? CS16->Value : CS32->Value; }
uint32_t getValue() const {
assert(isSet() && "COFFSymbolRef points to nothing!");
return CS16 ? CS16->Value : CS32->Value;
}
int32_t getSectionNumber() const {
assert(isSet() && "COFFSymbolRef points to nothing!");