From: Simon Pilgrim Date: Sun, 15 Sep 2019 15:38:26 +0000 (+0000) Subject: [DebugInfo] Don't dereference a dyn_cast result. NFCI. X-Git-Tag: llvmorg-11-init~9177 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4f234aaf2c9801364d1855dc82466c4a307360cb;p=platform%2Fupstream%2Fllvm.git [DebugInfo] Don't dereference a dyn_cast result. NFCI. The static analyzer is warning about a potential null dereference - but as we're in DataMemberLayoutItem we should be able to guarantee that the Symbol is a PDBSymbolData type, allowing us to use cast - and if not assert will fire for us. llvm-svn: 371933 --- diff --git a/llvm/lib/DebugInfo/PDB/UDTLayout.cpp b/llvm/lib/DebugInfo/PDB/UDTLayout.cpp index d8bc3dc..a8e1d0a 100644 --- a/llvm/lib/DebugInfo/PDB/UDTLayout.cpp +++ b/llvm/lib/DebugInfo/PDB/UDTLayout.cpp @@ -84,7 +84,7 @@ VBPtrLayoutItem::VBPtrLayoutItem(const UDTLayoutBase &Parent, } const PDBSymbolData &DataMemberLayoutItem::getDataMember() { - return *dyn_cast(Symbol); + return *cast(Symbol); } bool DataMemberLayoutItem::hasUDTLayout() const { return UdtLayout != nullptr; }