[pdb] Treat a stream size of ~0U as 0
My PDBs always have this size for stream 11. Not sure why.
llvm-svn: 273504
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
index a5c383e..1385e91 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
@@ -171,8 +171,10 @@
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 @@
StreamMap = Blocks;
}
-void PDBFile::commit() {}
\ No newline at end of file
+void PDBFile::commit() {}