summaryrefslogtreecommitdiff
path: root/tools/libclang/CIndexHigh.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-09 00:17:49 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-12-09 00:17:49 +0000
commit4451746d8f658b51eaf15dd24664a488457063a9 (patch)
treea4d9c000b7d1edc0588a72295ea5a3a32f0be536 /tools/libclang/CIndexHigh.cpp
parent48977874cb351f452102f8c15528eb1d8c7387e6 (diff)
downloadclang-4451746d8f658b51eaf15dd24664a488457063a9.tar.gz
clang-4451746d8f658b51eaf15dd24664a488457063a9.tar.bz2
clang-4451746d8f658b51eaf15dd24664a488457063a9.tar.xz
[libclang] Make sure we don't try to handle a CXCursor_NoDeclFound
passed to clang_findReferencesInFile. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CIndexHigh.cpp')
-rw-r--r--tools/libclang/CIndexHigh.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/libclang/CIndexHigh.cpp b/tools/libclang/CIndexHigh.cpp
index bbb6d6dcad..4eabefb925 100644
--- a/tools/libclang/CIndexHigh.cpp
+++ b/tools/libclang/CIndexHigh.cpp
@@ -344,6 +344,11 @@ void clang_findReferencesInFile(CXCursor cursor, CXFile file,
llvm::errs() << "clang_findReferencesInFile: Null cursor\n";
return;
}
+ if (cursor.kind == CXCursor_NoDeclFound) {
+ if (Logging)
+ llvm::errs() << "clang_findReferencesInFile: Got CXCursor_NoDeclFound\n";
+ return;
+ }
if (!file) {
if (Logging)
llvm::errs() << "clang_findReferencesInFile: Null file\n";