diff options
Diffstat (limited to 'clang/tools/libclang/CIndexUSRs.cpp')
| -rw-r--r-- | clang/tools/libclang/CIndexUSRs.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/tools/libclang/CIndexUSRs.cpp b/clang/tools/libclang/CIndexUSRs.cpp index 32c4db6abec..40d4fb1c694 100644 --- a/clang/tools/libclang/CIndexUSRs.cpp +++ b/clang/tools/libclang/CIndexUSRs.cpp @@ -845,6 +845,9 @@ CXString clang_getCursorUSR(CXCursor C) { if (clang_isDeclaration(K)) { Decl *D = cxcursor::getCursorDecl(C); + if (!D) + return createCXString(""); + CXTranslationUnit TU = cxcursor::getCursorTU(C); if (!TU) return createCXString(""); |

