From 40c19bc25249f3b210184798840bbf9529229b9c Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 10 May 2019 12:17:46 +0200 Subject: [PATCH] libclang: prevent infinite loop when searching for symbol documentation --- src/source_clang.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/source_clang.cc b/src/source_clang.cc index 5107a52..7a690f2 100644 --- a/src/source_clang.cc +++ b/src/source_clang.cc @@ -1588,7 +1588,7 @@ Source::ClangViewRefactor::ClangViewRefactor(const boost::filesystem::path &file } last_cursor = cursor; cursor = cursor.get_semantic_parent(); - } while(cursor.get_kind() != clangmm::Cursor::Kind::TranslationUnit); + } while(cursor && cursor.get_kind() != clangmm::Cursor::Kind::TranslationUnit); if(last_cursor.get_kind() != clangmm::Cursor::Kind::Namespace) data.emplace(++data.begin(), "");