Skip to content

Commit adf57a7

Browse files
committed
Aggressively ignore write errors during bad-alloc
1 parent 0ade5a1 commit adf57a7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ static void BadAllocErrorHandler(void *UserData,
103103
const char* Reason,
104104
bool GenCrashDiag) {
105105
const char *OOM = "rustc-LLVM ERROR: out of memory\n";
106-
write(2, OOM, strlen(OOM));
107-
write(2, Reason, strlen(Reason));
108-
write(2, "\n", 1);
106+
(void)!::write(2, OOM, strlen(OOM));
107+
(void)!::write(2, Reason, strlen(Reason));
108+
(void)!::write(2, "\n", 1);
109109
abort();
110110
}
111111

0 commit comments

Comments
 (0)