diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-15 15:38:26 +0000 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-09-15 15:38:26 +0000 |
commit | 4f234aaf2c9801364d1855dc82466c4a307360cb (patch) | |
tree | e2e5fda4949c10e9177ebeb80fa1dce6cbd445f0 /llvm/lib/DebugInfo | |
parent | b325c057322ce14b5c561d8ac49508adab7649e5 (diff) | |
download | bcm5719-llvm-4f234aaf2c9801364d1855dc82466c4a307360cb.tar.gz bcm5719-llvm-4f234aaf2c9801364d1855dc82466c4a307360cb.zip |
[DebugInfo] Don't dereference a dyn_cast<PDBSymbolData> 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<PDBSymbolData> - and if not assert will fire for us.
llvm-svn: 371933
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/UDTLayout.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/UDTLayout.cpp b/llvm/lib/DebugInfo/PDB/UDTLayout.cpp index d8bc3dc06e6..a8e1d0a619c 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<PDBSymbolData>(Symbol); + return *cast<PDBSymbolData>(Symbol); } bool DataMemberLayoutItem::hasUDTLayout() const { return UdtLayout != nullptr; } |