[PATCH] D64307: [clangd] Add a missing early return in getTypeHierarchy()

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 7 22:17:41 PDT 2019


nridge created this revision.
nridge added a reviewer: sammccall.
Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov.
Herald added a project: clang.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D64307

Files:
  clang-tools-extra/clangd/XRefs.cpp


Index: clang-tools-extra/clangd/XRefs.cpp
===================================================================
--- clang-tools-extra/clangd/XRefs.cpp
+++ clang-tools-extra/clangd/XRefs.cpp
@@ -1191,6 +1191,8 @@
   RecursionProtectionSet RPSet;
   Optional<TypeHierarchyItem> Result =
       getTypeAncestors(*CXXRD, AST.getASTContext(), RPSet);
+  if (!Result)
+    return Result;
 
   if ((Direction == TypeHierarchyDirection::Children ||
        Direction == TypeHierarchyDirection::Both) &&


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64307.208317.patch
Type: text/x-patch
Size: 493 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190708/219451d8/attachment.bin>


More information about the cfe-commits mailing list