aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-04-28 23:47:27 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-04-28 23:47:27 +0000
commit1573b242aeef45124c68a22a995fbc4bff2cc868 (patch)
tree0b791a51232db3c209c16dd4bf8092005ab7d08c /llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
parentf84547c6e0ec638cdfe7367572cd5d57712ea0b9 (diff)
downloadllvm-1573b242aeef45124c68a22a995fbc4bff2cc868.zip
llvm-1573b242aeef45124c68a22a995fbc4bff2cc868.tar.gz
llvm-1573b242aeef45124c68a22a995fbc4bff2cc868.tar.bz2
[llvm-pdbdump] Restore error messages, handle bad block sizes
We lost the ability to report errors, bring it back. Also, correctly validate the block size. llvm-svn: 267955
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
index 6fefafe5..be1368e 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
@@ -127,7 +127,7 @@ std::error_code PDBFile::parseFileHeaders() {
return std::make_error_code(std::errc::illegal_byte_sequence);
// We don't support blocksizes which aren't a multiple of four bytes.
- if (SB->BlockSize % sizeof(support::ulittle32_t) != 0)
+ if (SB->BlockSize == 0 || SB->BlockSize % sizeof(support::ulittle32_t) != 0)
return std::make_error_code(std::errc::not_supported);
// We don't support directories whose sizes aren't a multiple of four bytes.