summaryrefslogtreecommitdiff
path: root/tools/libclang/CIndexInclusionStack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libclang/CIndexInclusionStack.cpp')
-rw-r--r--tools/libclang/CIndexInclusionStack.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/libclang/CIndexInclusionStack.cpp b/tools/libclang/CIndexInclusionStack.cpp
index a6d3115409b6..365609b4f37b 100644
--- a/tools/libclang/CIndexInclusionStack.cpp
+++ b/tools/libclang/CIndexInclusionStack.cpp
@@ -24,7 +24,11 @@ using namespace clang;
extern "C" {
void clang_getInclusions(CXTranslationUnit TU, CXInclusionVisitor CB,
CXClientData clientData) {
-
+ if (cxtu::isNotUsableTU(TU)) {
+ LOG_BAD_TU(TU);
+ return;
+ }
+
ASTUnit *CXXUnit = cxtu::getASTUnit(TU);
SourceManager &SM = CXXUnit->getSourceManager();
ASTContext &Ctx = CXXUnit->getASTContext();