This is an archive of the discontinued LLVM Phabricator instance.

[Index] Ignore nullptr decls for indexing
ClosedPublic

Authored by ahoppen on May 6 2021, 9:52 AM.

Details

Summary

We can end up with a call to indexTopLevelDecl(D) with D == nullptr in non-assert builds e.g. when indexing a module in indexModule and

  • ASTReader::GetDecl returns nullptr if Index >= DeclsLoaded.size(), thus returning nullptr

> ModuleDeclIterator::operator* returns nullptr

> we call IndexCtx.indexTopLevelDecl with nullptr

Be resilient and just ignore the nullptr decls during indexing.

Diff Detail

Event Timeline

ahoppen created this revision.May 6 2021, 9:52 AM
ahoppen requested review of this revision.May 6 2021, 9:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 6 2021, 9:52 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
akyrtzi accepted this revision.May 6 2021, 1:09 PM
This revision is now accepted and ready to land.May 6 2021, 1:09 PM
This revision was automatically updated to reflect the committed changes.