mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-04 10:30:30 +00:00
[PDB] Fix failure on big endian machines.
We changed an ArrayRef<uint8_t> to an ArrayRef<uint32_t>, but it needs to be an ArrayRef<support::ulittle32_t>. We also change ArrayRef<> to FixedStreamArray<>. Technically an ArrayRef<> will work, but it can cause a copy in the underlying implementation if the memory is not contiguous, and there's no reason not to use a FixedStreamArray<>. Thanks to nemanjai@ and thakis@ for helping me track this down and confirm the fix. llvm-svn: 344063
This commit is contained in:
parent
6209430105
commit
7fd80a3c2e
@ -52,7 +52,7 @@ class GSIHashTable {
|
||||
public:
|
||||
const GSIHashHeader *HashHdr;
|
||||
FixedStreamArray<PSHashRecord> HashRecords;
|
||||
ArrayRef<uint32_t> HashBitmap;
|
||||
FixedStreamArray<support::ulittle32_t> HashBitmap;
|
||||
FixedStreamArray<support::ulittle32_t> HashBuckets;
|
||||
std::array<int32_t, IPHR_HASH + 1> BucketMap;
|
||||
|
||||
|
@ -121,7 +121,8 @@ static Error readGSIHashRecords(FixedStreamArray<PSHashRecord> &HashRecords,
|
||||
|
||||
static Error
|
||||
readGSIHashBuckets(FixedStreamArray<support::ulittle32_t> &HashBuckets,
|
||||
ArrayRef<uint32_t> &HashBitmap, const GSIHashHeader *HashHdr,
|
||||
FixedStreamArray<support::ulittle32_t> &HashBitmap,
|
||||
const GSIHashHeader *HashHdr,
|
||||
MutableArrayRef<int32_t> BucketMap,
|
||||
BinaryStreamReader &Reader) {
|
||||
if (auto EC = checkHashHdrVersion(HashHdr))
|
||||
|
@ -1708,11 +1708,6 @@ Error DumpOutputStyle::dumpSymbolsFromGSI(const GSIHashTable &Table,
|
||||
|
||||
// Return early if we aren't dumping public hash table and address map info.
|
||||
if (HashExtras) {
|
||||
ArrayRef<uint8_t> BitmapBytes(
|
||||
reinterpret_cast<const uint8_t *>(Table.HashBitmap.data()),
|
||||
Table.HashBitmap.size() * sizeof(uint32_t));
|
||||
P.formatBinary("Hash Bitmap", BitmapBytes, 0);
|
||||
|
||||
P.formatLine("Hash Entries");
|
||||
{
|
||||
AutoIndent Indent2(P);
|
||||
|
Loading…
x
Reference in New Issue
Block a user