diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp b/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp index 529f6703789..d76852be08a 100644 --- a/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/GlobalsStream.cpp @@ -57,13 +57,16 @@ GlobalsStream::findRecordsByName(StringRef Name, return Result; uint32_t ChainStartOffset = GlobalsTable.HashBuckets[CompressedBucketIndex]; - uint32_t NextChainStart = GlobalsTable.HashBuckets.size(); - if (static_cast<uint32_t>(CompressedBucketIndex + 1) < NextChainStart) - NextChainStart = GlobalsTable.HashBuckets[CompressedBucketIndex + 1]; + uint32_t NextChainOffset = GlobalsTable.HashBuckets.size() * 12; + uint32_t LastBucketIndex = GlobalsTable.HashBuckets.size() - 1; + if (static_cast<uint32_t>(CompressedBucketIndex) < LastBucketIndex) { + NextChainOffset = GlobalsTable.HashBuckets[CompressedBucketIndex + 1]; + } ChainStartOffset /= 12; - NextChainStart /= 12; + NextChainOffset /= 12; - while (ChainStartOffset < NextChainStart) { + auto &Back = GlobalsTable.HashRecords.back(); + while (ChainStartOffset < NextChainOffset) { PSHashRecord PSH = GlobalsTable.HashRecords[ChainStartOffset]; uint32_t Off = PSH.Off - 1; codeview::CVSymbol Record = Symbols.readRecord(Off); |