forked from OSchip/llvm-project
[libclang] When there's a file error when saving the PCH, make sure to
clear the error from raw_fd_ostream, otherwise we will crash. rdar://10976410 llvm-svn: 152605
This commit is contained in:
parent
68fc21562f
commit
eeea16a0d5
|
@ -2411,8 +2411,10 @@ CXSaveError ASTUnit::Save(StringRef File) {
|
|||
|
||||
serialize(Out);
|
||||
Out.close();
|
||||
if (Out.has_error())
|
||||
if (Out.has_error()) {
|
||||
Out.clear_error();
|
||||
return CXSaveError_Unknown;
|
||||
}
|
||||
|
||||
if (llvm::sys::fs::rename(TempPath.str(), File)) {
|
||||
bool exists;
|
||||
|
|
Loading…
Reference in New Issue