[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
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 @@
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.