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