]> granicus.if.org Git - llvm/commitdiff
[pdb] Treat a stream size of ~0U as 0
authorReid Kleckner <rnk@google.com>
Wed, 22 Jun 2016 22:42:24 +0000 (22:42 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 22 Jun 2016 22:42:24 +0000 (22:42 +0000)
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

index a5c383e5f49e3cc2143aad7c63aeb6cad74e6b42..1385e91f7ac66b79ac538567331ecef03c8b81ac 100644 (file)
@@ -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<ArrayRef<support::ulittle32_t>> Blocks) {
   StreamMap = Blocks;
 }
 
-void PDBFile::commit() {}
\ No newline at end of file
+void PDBFile::commit() {}