aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-16 18:13:00 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-01-16 18:13:00 +0000
commitd7bf4a4e9c100fb5fe098b0e1870d61891c09dd3 (patch)
tree17e0ac27c0fb4f61e1ea1d2b5b23aacb2d3beacb
parentf7f12646e8f8a45abea3ebcb81928fbe08187f97 (diff)
[libclang] In clang_reparseTranslationUnit_Impl, move the check whether TU is
null before using it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172632 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/libclang/CIndex.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 7b271dcd50..6f790ae685 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -2834,6 +2834,8 @@ static void clang_reparseTranslationUnit_Impl(void *UserData) {
ReparseTranslationUnitInfo *RTUI =
static_cast<ReparseTranslationUnitInfo*>(UserData);
CXTranslationUnit TU = RTUI->TU;
+ if (!TU)
+ return;
// Reset the associated diagnostics.
delete static_cast<CXDiagnosticSetImpl*>(TU->Diagnostics);
@@ -2845,9 +2847,6 @@ static void clang_reparseTranslationUnit_Impl(void *UserData) {
(void) options;
RTUI->result = 1;
- if (!TU)
- return;
-
CIndexer *CXXIdx = (CIndexer*)TU->CIdx;
if (CXXIdx->isOptEnabled(CXGlobalOpt_ThreadBackgroundPriorityForEditing))
setThreadBackgroundPriority();