From 1573b242aeef45124c68a22a995fbc4bff2cc868 Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 28 Apr 2016 23:47:27 +0000 Subject: [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 --- llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp index 6fefafe597c..be1368eb94f 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. -- cgit v1.2.3