From fa469d0efd003aeb31d2fb06c22b547c22937a5a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Fri, 9 Dec 2011 00:17:49 +0000 Subject: [libclang] Make sure we don't try to handle a CXCursor_NoDeclFound passed to clang_findReferencesInFile. llvm-svn: 146211 --- clang/tools/libclang/CIndexHigh.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/tools/libclang/CIndexHigh.cpp') diff --git a/clang/tools/libclang/CIndexHigh.cpp b/clang/tools/libclang/CIndexHigh.cpp index bbb6d6dcadb..4eabefb9259 100644 --- a/clang/tools/libclang/CIndexHigh.cpp +++ b/clang/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"; -- cgit v1.2.3