diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2016-05-28 05:59:19 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2016-05-28 05:59:19 +0000 |
| commit | 7e950b261ab2da7b385f01dae7afd1f38b87659b (patch) | |
| tree | b5cbd17d7972a0024dda98d98b21bbbe9de1e1a2 /llvm/lib/DebugInfo/PDB/Raw | |
| parent | 67a94a795d760c963cb21ad851769c8fd7734883 (diff) | |
| download | bcm5719-llvm-7e950b261ab2da7b385f01dae7afd1f38b87659b.tar.gz bcm5719-llvm-7e950b261ab2da7b385f01dae7afd1f38b87659b.zip | |
Make sure the directory contains info for all streams
llvm-svn: 271103
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw')
| -rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp index 68ed6c82efd..d0fbb142ec3 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp @@ -269,10 +269,15 @@ Error PDBFile::parseStreamData() { } } - for (uint32_t SI = 0; SI != NumStreams; ++SI) { + if (Context->StreamSizes.size() != NumStreams) + return make_error<RawError>( + raw_error_code::corrupt_file, + "The directory has fewer streams then expected"); + + for (uint32_t I = 0; I != NumStreams; ++I) { uint64_t NumExpectedStreamBlocks = - bytesToBlocks(getStreamByteSize(SI), getBlockSize()); - size_t NumStreamBlocks = getStreamBlockList(SI).size(); + bytesToBlocks(getStreamByteSize(I), getBlockSize()); + size_t NumStreamBlocks = getStreamBlockList(I).size(); if (NumExpectedStreamBlocks != NumStreamBlocks) return make_error<RawError>(raw_error_code::corrupt_file, "The number of stream blocks is not " |

