Skip to content

Commit a52cb0a

Browse files
authored
[PDB] Fix missing consumeError which raise error with asserts enabled (llvm#116480)
As mentioned in the title, the missing `consumeError` triggers assertions.
1 parent 756fe54 commit a52cb0a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

llvm/lib/DebugInfo/PDB/Native/SymbolCache.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,12 +388,16 @@ SymbolCache::findPublicSymbolBySectOffset(uint32_t Sect, uint32_t Offset) {
388388
return getSymbolById(Iter->second);
389389

390390
auto Publics = Session.getPDBFile().getPDBPublicsStream();
391-
if (!Publics)
391+
if (!Publics) {
392+
consumeError(Publics.takeError());
392393
return nullptr;
394+
}
393395

394396
auto ExpectedSyms = Session.getPDBFile().getPDBSymbolStream();
395-
if (!ExpectedSyms)
397+
if (!ExpectedSyms) {
398+
consumeError(ExpectedSyms.takeError());
396399
return nullptr;
400+
}
397401
BinaryStreamRef SymStream =
398402
ExpectedSyms->getSymbolArray().getUnderlyingStream();
399403

0 commit comments

Comments
 (0)