From 741cc3531a6a372f8b5524362eb7930905e983bb Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Mon, 6 Aug 2018 19:35:00 +0000 Subject: [llvm-pdbutil] Support PDBs without a DBI stream Differential Revision: https://reviews.llvm.org/D50258 llvm-svn: 339045 --- llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp') diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp index 78b11937f05..c5ce3e0091f 100644 --- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp @@ -401,7 +401,9 @@ uint32_t PDBFile::getPointerSize() { return 4; } -bool PDBFile::hasPDBDbiStream() const { return StreamDBI < getNumStreams(); } +bool PDBFile::hasPDBDbiStream() const { + return StreamDBI < getNumStreams() && getStreamByteSize(StreamDBI) > 0; +} bool PDBFile::hasPDBGlobalsStream() { auto DbiS = getPDBDbiStream(); -- cgit v1.2.3