Skip to content

Commit c4f5993

Browse files
authored
[llvm][Support] Call clear_error in LockFileManager to avoid report_fatal_error (#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
1 parent b14220e commit c4f5993

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));
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)