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

llvm-svn: 269898
This commit is contained in:
Daniel Sanders 2016-05-18 09:59:14 +00:00
parent b0aa9f2cbe
commit c819d903e1
1 changed files with 6 additions and 2 deletions

View File

@ -138,10 +138,14 @@ Error PublicsStream::reload() {
// corrupted streams. // corrupted streams.
// Hash buckets follow. // Hash buckets follow.
HashBuckets.resize(NumBuckets); std::vector<ulittle32_t> TempHashBuckets;
if (auto EC = Reader.readArray<uint32_t>(HashBuckets)) TempHashBuckets.resize(NumBuckets);
if (auto EC = Reader.readArray<ulittle32_t>(TempHashBuckets))
return make_error<RawError>(raw_error_code::corrupt_file, return make_error<RawError>(raw_error_code::corrupt_file,
"Hash buckets corrupted."); "Hash buckets corrupted.");
HashBuckets.resize(NumBuckets);
std::copy(TempHashBuckets.begin(), TempHashBuckets.end(),
HashBuckets.begin());
// Something called "address map" follows. // Something called "address map" follows.
AddressMap.resize(Header->AddrMap / sizeof(uint32_t)); AddressMap.resize(Header->AddrMap / sizeof(uint32_t));