Skip to content

Commit

Permalink
[DebugInfo] Don't dereference a dyn_cast<PDBSymbolData> result. NFCI.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@371933 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
RKSimon committed Sep 15, 2019
1 parent f343dcd commit 07c7640
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/DebugInfo/PDB/UDTLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down

0 comments on commit 07c7640

Please sign in to comment.