aboutsummaryrefslogtreecommitdiff
path: root/tools/c-index-test
diff options
context:
space:
mode:
Diffstat (limited to 'tools/c-index-test')
-rw-r--r--tools/c-index-test/c-index-test.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index 8ab7f9410d..ae970fb952 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -709,6 +709,11 @@ static int perform_test_load(CXIndex Idx, CXTranslationUnit TU,
PV(TU);
PrintDiagnostics(TU);
+ if (checkForErrors(TU) != 0) {
+ clang_disposeTranslationUnit(TU);
+ return -1;
+ }
+
clang_disposeTranslationUnit(TU);
return 0;
}
@@ -830,9 +835,6 @@ int perform_test_reparse_source(int argc, const char **argv, int trials,
result = perform_test_load(Idx, TU, filter, NULL, Visitor, PV);
- if (checkForErrors(TU) != 0)
- return -1;
-
free_remapped_files(unsaved_files, num_unsaved_files);
clang_disposeIndex(Idx);
return result;