aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-09 20:03:03 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-04-09 20:03:03 +0000
commit84347225fcf5aae5ff982e94f4c95548ae26b846 (patch)
treef02dad33120008cf9ff1674618fdd4ad5731049d /tools
parent3c9a0240b6db6ee02a24f48c753089bda48843ae (diff)
[libclang] In cxtu::getASTUnit(), check for a null CXTranslationUnit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179121 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/libclang/CXTranslationUnit.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/libclang/CXTranslationUnit.h b/tools/libclang/CXTranslationUnit.h
index 699b74a642..bdc171cff6 100644
--- a/tools/libclang/CXTranslationUnit.h
+++ b/tools/libclang/CXTranslationUnit.h
@@ -39,6 +39,8 @@ namespace cxtu {
CXTranslationUnitImpl *MakeCXTranslationUnit(CIndexer *CIdx, ASTUnit *AU);
static inline ASTUnit *getASTUnit(CXTranslationUnit TU) {
+ if (!TU)
+ return 0;
return TU->TheASTUnit;
}