summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/Raw/PublicsStream.cpp
diff options
context:
space:
mode:
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 8d4c58e6569..f51a8ef17a2 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,
OpenPOWER on IntegriCloud