]> granicus.if.org Git - clang/commitdiff
Remove assert added in r201249.
authorDaniel Jasper <djasper@google.com>
Thu, 13 Feb 2014 14:24:14 +0000 (14:24 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 13 Feb 2014 14:24:14 +0000 (14:24 +0000)
This triggers on one of our internal tests.

Dmitri:
I do not understand this part of the codebase well enough to locate the
underlying cause easily. If the correct fix is not obvious, I can try to
debug the problem further or try to come up with reduced test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201329 91177308-0d34-0410-b5e6-96231b3b80d8

tools/libclang/CIndex.cpp

index 63acd0abd59865d5e52a0d06de908d2be8d6a46e..a74feabf06f3c42d32c382890e7613c326fbf7d2 100644 (file)
@@ -2826,8 +2826,12 @@ clang_parseTranslationUnit(CXIndex CIdx,
       CIdx, source_filename, command_line_args, num_command_line_args,
       unsaved_files, num_unsaved_files, options, &TU);
   (void)Result;
-  assert((TU && Result == CXError_Success) ||
-         (!TU && Result != CXError_Success));
+
+  // FIXME: This probably papers over a problem. If the result is not success,
+  // no TU should be set.
+  if (Result != CXError_Success)
+    return 0;
+
   return TU;
 }