From 07c764097f82421c5c199f1a4fd9cfc75a60a369 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Sun, 15 Sep 2019 15:38:26 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371933 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/PDB/UDTLayout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DebugInfo/PDB/UDTLayout.cpp b/lib/DebugInfo/PDB/UDTLayout.cpp index d8bc3dc06e6..a8e1d0a619c 100644 --- a/lib/DebugInfo/PDB/UDTLayout.cpp +++ b/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; } -- 2.50.1