[PATCH] D56916: Fix crash due to ObjCPropertyDecl

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 18 10:42:50 PST 2019


ilya-biryukov accepted this revision.
ilya-biryukov added a comment.
This revision is now accepted and ready to land.

Thanks for fixing this.
Quick LGTM to fix a crash, albeit a fews NITs.



================
Comment at: clangd/index/SymbolCollector.cpp:372
 
+  // ObjCPropertyDecl may have an OrigD of ObjCPropertyImplDecl, which is
+  // not a NamedDecl.
----------------
Could you please leave a FIXME mentioning objc properties are not indexed properly here?


================
Comment at: clangd/index/SymbolCollector.cpp:374
+  // not a NamedDecl.
+  if (!isa<NamedDecl>(ASTNode.OrigD))
+    return true;
----------------
Maybe use `llvm_dyn_cast` and check for null? (To avoid double-cast)



Repository:
  rCTE Clang Tools Extra

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

https://reviews.llvm.org/D56916





More information about the cfe-commits mailing list