Skip to content

Commit 3eedd76

Browse files
committed
[llvm][Support] Call clear_error in LockFileManager to avoid report_fatal_error (llvm#83655)
As per the comment in `raw_fd_ostream`'s destructor, you must call `clear_error()` to prevent a call to `report_fatal_error()`. There's not really a way to test this, but we did encounter it in the wild. rdar://117347895 (cherry picked from commit c4f5993)
1 parent 7fe0912 commit 3eedd76

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

llvm/lib/Support/LockFileManager.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ LockFileManager::LockFileManager(StringRef FileName)
205205
S.append(std::string(UniqueLockFileName.str()));
206206
setError(Out.error(), S);
207207
sys::fs::remove(UniqueLockFileName);
208+
// Don't call report_fatal_error.
209+
Out.clear_error();
208210
return;
209211
}
210212
}

0 commit comments

Comments
 (0)