Skip to content
Commit a3a8a1a1 authored by Alex Hoppen's avatar Alex Hoppen Committed by Argyrios Kyrtzidis
Browse files

[Index] Ignore nullptr decls for indexing

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.

Reviewed By: akyrtzi

Differential Revision: https://reviews.llvm.org/D102001
parent 6304c083
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment