mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-04 09:37:20 +00:00
[PDB] Indicate which type record failed hash validation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274308 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
378e1693a1
commit
5ec7ee3af8
@ -118,7 +118,7 @@ private:
|
||||
template <typename T> Error verify(T &Rec) {
|
||||
uint32_t Hash = getTpiHash(Rec, *RawRecord);
|
||||
if (Hash % NumHashBuckets != HashValues[Index])
|
||||
return make_error<RawError>(raw_error_code::invalid_tpi_hash);
|
||||
return errorInvalidHash();
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
@ -127,10 +127,16 @@ private:
|
||||
support::endian::write32le(Buf, Rec.getUDT().getIndex());
|
||||
uint32_t Hash = hashStringV1(StringRef(Buf, 4));
|
||||
if (Hash % NumHashBuckets != HashValues[Index])
|
||||
return make_error<RawError>(raw_error_code::invalid_tpi_hash);
|
||||
return errorInvalidHash();
|
||||
return Error::success();
|
||||
}
|
||||
|
||||
Error errorInvalidHash() {
|
||||
return make_error<RawError>(
|
||||
raw_error_code::invalid_tpi_hash,
|
||||
"Type index is 0x" + utohexstr(TypeIndex::FirstNonSimpleIndex + Index));
|
||||
}
|
||||
|
||||
FixedStreamArray<support::ulittle32_t> HashValues;
|
||||
const CVRecord<TypeLeafKind> *RawRecord;
|
||||
uint32_t NumHashBuckets;
|
||||
|
Loading…
x
Reference in New Issue
Block a user