[PATCH] D102001: [Index] Ignore nullptr decls for indexing

Argyrios Kyrtzidis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 6 13:12:58 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGa3a8a1a15b52: [Index] Ignore nullptr decls for indexing (authored by ahoppen, committed by akyrtzi).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102001/new/

https://reviews.llvm.org/D102001

Files:
  clang/lib/Index/IndexDecl.cpp


Index: clang/lib/Index/IndexDecl.cpp
===================================================================
--- clang/lib/Index/IndexDecl.cpp
+++ clang/lib/Index/IndexDecl.cpp
@@ -759,7 +759,7 @@
 }
 
 bool IndexingContext::indexTopLevelDecl(const Decl *D) {
-  if (D->getLocation().isInvalid())
+  if (!D || D->getLocation().isInvalid())
     return true;
 
   if (isa<ObjCMethodDecl>(D))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102001.343488.patch
Type: text/x-patch
Size: 387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210506/7700ffab/attachment.bin>


More information about the cfe-commits mailing list