aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-05-27 16:16:56 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-05-27 16:16:56 +0000
commit836937ed795dd4b6ea0da4dbf1bdab2806dd248d (patch)
tree88eab8299a4a7e9ab0c504504b6f2aa3a958ef56 /llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
parent9efba74778fcc91f12e5178f42fcb1d6208f5bce (diff)
downloadllvm-836937ed795dd4b6ea0da4dbf1bdab2806dd248d.zip
llvm-836937ed795dd4b6ea0da4dbf1bdab2806dd248d.tar.gz
llvm-836937ed795dd4b6ea0da4dbf1bdab2806dd248d.tar.bz2
Make sure these error codes are marked as checked
llvm-svn: 271013
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
index 8d4c58e..f51a8ef 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
@@ -106,15 +106,17 @@ Error PublicsStream::reload() {
"Invalid HR array size.");
uint32_t NumHashRecords = HashHdr->HrSize / sizeof(PSHashRecord);
if (auto EC = Reader.readArray(HashRecords, NumHashRecords))
- return make_error<RawError>(raw_error_code::corrupt_file,
- "Could not read an HR array");
+ return joinErrors(std::move(EC),
+ make_error<RawError>(raw_error_code::corrupt_file,
+ "Could not read an HR array"));
// A bitmap of a fixed length follows.
size_t BitmapSizeInBits = alignTo(IPHR_HASH + 1, 32);
uint32_t NumBitmapEntries = BitmapSizeInBits / 8;
if (auto EC = Reader.readBytes(NumBitmapEntries, Bitmap))
- return make_error<RawError>(raw_error_code::corrupt_file,
- "Could not read a bitmap.");
+ return joinErrors(std::move(EC),
+ make_error<RawError>(raw_error_code::corrupt_file,
+ "Could not read a bitmap."));
for (uint8_t B : Bitmap)
NumBuckets += countPopulation(B);
@@ -125,24 +127,28 @@ Error PublicsStream::reload() {
// Hash buckets follow.
if (auto EC = Reader.readArray(HashBuckets, NumBuckets))
- return make_error<RawError>(raw_error_code::corrupt_file,
- "Hash buckets corrupted.");
+ return joinErrors(std::move(EC),
+ make_error<RawError>(raw_error_code::corrupt_file,
+ "Hash buckets corrupted."));
// Something called "address map" follows.
uint32_t NumAddressMapEntries = Header->AddrMap / sizeof(uint32_t);
if (auto EC = Reader.readArray(AddressMap, NumAddressMapEntries))
- return make_error<RawError>(raw_error_code::corrupt_file,
- "Could not read an address map.");
+ return joinErrors(std::move(EC),
+ make_error<RawError>(raw_error_code::corrupt_file,
+ "Could not read an address map."));
// Something called "thunk map" follows.
if (auto EC = Reader.readArray(ThunkMap, Header->NumThunks))
- return make_error<RawError>(raw_error_code::corrupt_file,
- "Could not read a thunk map.");
+ return joinErrors(std::move(EC),
+ make_error<RawError>(raw_error_code::corrupt_file,
+ "Could not read a thunk map."));
// Something called "section map" follows.
if (auto EC = Reader.readArray(SectionOffsets, Header->NumSections))
- return make_error<RawError>(raw_error_code::corrupt_file,
- "Could not read a section map.");
+ return joinErrors(std::move(EC),
+ make_error<RawError>(raw_error_code::corrupt_file,
+ "Could not read a section map."));
if (Reader.bytesRemaining() > 0)
return make_error<RawError>(raw_error_code::corrupt_file,