[PDB] Handle an empty globals hash table with no buckets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316722 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2017-10-27 00:45:51 +00:00
parent b2c3f3b949
commit eb271e82ff
4 changed files with 13 additions and 4 deletions
+3 -2
View File
@@ -117,7 +117,8 @@ Error GSIHashTable::read(BinaryStreamReader &Reader) {
return EC;
if (auto EC = readGSIHashRecords(HashRecords, HashHdr, Reader))
return EC;
if (auto EC = readGSIHashBuckets(HashBuckets, HashBitmap, HashHdr, Reader))
return EC;
if (HashHdr->HrSize > 0)
if (auto EC = readGSIHashBuckets(HashBuckets, HashBitmap, HashHdr, Reader))
return EC;
return Error::success();
}
Binary file not shown.
@@ -0,0 +1,6 @@
RUN: llvm-pdbutil dump -globals %S/Inputs/pdbdump-globals-empty.pdb | FileCheck %s
CHECK: Global Symbols
CHECK: ============================================================
CHECK: Records
CHECK-NOT: S_
+4 -2
View File
@@ -639,9 +639,11 @@ Error DumpOutputStyle::dumpUdtStats() {
}
auto &SymbolRecords = cantFail(getPdb().getPDBSymbolStream());
auto &Globals = cantFail(getPdb().getPDBGlobalsStream());
auto ExpGlobals = getPdb().getPDBGlobalsStream();
if (!ExpGlobals)
return ExpGlobals.takeError();
for (uint32_t PubSymOff : Globals.getGlobalsTable()) {
for (uint32_t PubSymOff : ExpGlobals->getGlobalsTable()) {
CVSymbol Sym = SymbolRecords.readRecord(PubSymOff);
HandleOneSymbol(Sym);
}