From: Daniel Jasper Date: Thu, 13 Feb 2014 14:24:14 +0000 (+0000) Subject: Remove assert added in r201249. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1617d450f264b946bcb8c15571735492caf66a92;p=clang Remove assert added in r201249. 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 --- diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 63acd0abd5..a74feabf06 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -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; }