mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-25 07:31:32 +00:00
[pdbdump] Verify the size of TPI hash records.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271954 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6039b79bbe
commit
d97680dbf0
@ -103,7 +103,12 @@ Error TpiStream::reload() {
|
||||
// Hash indices, hash values, etc come from the hash stream.
|
||||
HashStream.reset(new MappedBlockStream(Header->HashStreamIndex, Pdb));
|
||||
codeview::StreamReader HSR(*HashStream);
|
||||
|
||||
uint32_t NumHashValues = Header->HashValueBuffer.Length / sizeof(ulittle32_t);
|
||||
if (NumHashValues != NumTypeRecords())
|
||||
return make_error<RawError>(
|
||||
raw_error_code::corrupt_file,
|
||||
"TPI hash count does not match with the number of type records.");
|
||||
HSR.setOffset(Header->HashValueBuffer.Off);
|
||||
if (auto EC = HSR.readArray(HashValues, NumHashValues))
|
||||
return EC;
|
||||
|
Loading…
x
Reference in New Issue
Block a user