Try again to fix pdbdump-headers.test on big-endian hosts after r269861.

r269898 fixed the problem with HashBuckets but the same issue occurred with
AddressMap and ThunkMap too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269913 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Sanders 2016-05-18 12:36:25 +00:00
parent 1db659ede4
commit 8d706cc7df

View File

@ -138,8 +138,7 @@ Error PublicsStream::reload() {
// corrupted streams.
// Hash buckets follow.
std::vector<ulittle32_t> TempHashBuckets;
TempHashBuckets.resize(NumBuckets);
std::vector<ulittle32_t> TempHashBuckets(NumBuckets);
if (auto EC = Reader.readArray<ulittle32_t>(TempHashBuckets))
return make_error<RawError>(raw_error_code::corrupt_file,
"Hash buckets corrupted.");
@ -148,16 +147,21 @@ Error PublicsStream::reload() {
HashBuckets.begin());
// Something called "address map" follows.
AddressMap.resize(Header->AddrMap / sizeof(uint32_t));
if (auto EC = Reader.readArray<uint32_t>(AddressMap))
std::vector<ulittle32_t> TempAddressMap(Header->AddrMap / sizeof(uint32_t));
if (auto EC = Reader.readArray<ulittle32_t>(TempAddressMap))
return make_error<RawError>(raw_error_code::corrupt_file,
"Could not read an address map.");
AddressMap.resize(Header->AddrMap / sizeof(uint32_t));
std::copy(TempAddressMap.begin(), TempAddressMap.end(), AddressMap.begin());
// Something called "thunk map" follows.
std::vector<ulittle32_t> TempThunkMap(Header->NumThunks);
ThunkMap.resize(Header->NumThunks);
if (auto EC = Reader.readArray<uint32_t>(ThunkMap))
if (auto EC = Reader.readArray<ulittle32_t>(TempThunkMap))
return make_error<RawError>(raw_error_code::corrupt_file,
"Could not read a thunk map.");
ThunkMap.resize(Header->NumThunks);
std::copy(TempThunkMap.begin(), TempThunkMap.end(), ThunkMap.begin());
// Something called "section map" follows.
std::vector<SectionOffset> SectionMap(Header->NumSections);