Aggressively ignore write errors during bad-alloc

This commit is contained in:
Josh Stone 2024-03-15 16:48:16 -07:00
parent 0ade5a11f5
commit adf57a75d5

View File

@ -103,9 +103,9 @@ static void BadAllocErrorHandler(void *UserData,
const char* Reason, const char* Reason,
bool GenCrashDiag) { bool GenCrashDiag) {
const char *OOM = "rustc-LLVM ERROR: out of memory\n"; const char *OOM = "rustc-LLVM ERROR: out of memory\n";
write(2, OOM, strlen(OOM)); (void)!::write(2, OOM, strlen(OOM));
write(2, Reason, strlen(Reason)); (void)!::write(2, Reason, strlen(Reason));
write(2, "\n", 1); (void)!::write(2, "\n", 1);
abort(); abort();
} }