From e97bf8177133bfe65e792d5863d7c97880973e5d Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 22 Jun 2016 22:42:24 +0000 Subject: [PATCH] [pdb] Treat a stream size of ~0U as 0 My PDBs always have this size for stream 11. Not sure why. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273504 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/DebugInfo/PDB/Raw/PDBFile.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/lib/DebugInfo/PDB/Raw/PDBFile.cpp index a5c383e5f49..1385e91f7ac 100644 --- a/lib/DebugInfo/PDB/Raw/PDBFile.cpp +++ b/lib/DebugInfo/PDB/Raw/PDBFile.cpp @@ -171,8 +171,10 @@ Error PDBFile::parseStreamData() { if (auto EC = Reader.readArray(StreamSizes, NumStreams)) return EC; for (uint32_t I = 0; I < NumStreams; ++I) { + uint32_t StreamSize = getStreamByteSize(I); + // FIXME: What does StreamSize ~0U mean? uint64_t NumExpectedStreamBlocks = - bytesToBlocks(getStreamByteSize(I), SB->BlockSize); + StreamSize == UINT32_MAX ? 0 : bytesToBlocks(StreamSize, SB->BlockSize); // For convenience, we store the block array contiguously. This is because // if someone calls setStreamMap(), it is more convenient to be able to call @@ -331,4 +333,4 @@ void PDBFile::setStreamMap(ArrayRef> Blocks) { StreamMap = Blocks; } -void PDBFile::commit() {} \ No newline at end of file +void PDBFile::commit() {} -- 2.50.1