[cfe-commits] r144514 - /cfe/trunk/tools/c-index-test/c-index-test.c

Argyrios Kyrtzidis akyrtzi at gmail.com
Sun Nov 13 15:39:14 PST 2011


Author: akirtzidis
Date: Sun Nov 13 17:39:14 2011
New Revision: 144514

URL: http://llvm.org/viewvc/llvm-project?rev=144514&view=rev
Log:
[libclang] Move the check for errors in c-index-test before the TU gets disposed.

Modified:
    cfe/trunk/tools/c-index-test/c-index-test.c

Modified: cfe/trunk/tools/c-index-test/c-index-test.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/c-index-test/c-index-test.c?rev=144514&r1=144513&r2=144514&view=diff
==============================================================================
--- cfe/trunk/tools/c-index-test/c-index-test.c (original)
+++ cfe/trunk/tools/c-index-test/c-index-test.c Sun Nov 13 17:39:14 2011
@@ -709,6 +709,11 @@
     PV(TU);
 
   PrintDiagnostics(TU);
+  if (checkForErrors(TU) != 0) {
+    clang_disposeTranslationUnit(TU);
+    return -1;
+  }
+
   clang_disposeTranslationUnit(TU);
   return 0;
 }
@@ -830,9 +835,6 @@
   
   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;





More information about the cfe-commits mailing list