From adf57a75d5014b620f2c09587b6e1e108a7622da Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 15 Mar 2024 16:48:16 -0700 Subject: [PATCH] Aggressively ignore write errors during bad-alloc --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 072620c65a5..861c0a6e79a 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -103,9 +103,9 @@ static void BadAllocErrorHandler(void *UserData, const char* Reason, bool GenCrashDiag) { const char *OOM = "rustc-LLVM ERROR: out of memory\n"; - write(2, OOM, strlen(OOM)); - write(2, Reason, strlen(Reason)); - write(2, "\n", 1); + (void)!::write(2, OOM, strlen(OOM)); + (void)!::write(2, Reason, strlen(Reason)); + (void)!::write(2, "\n", 1); abort(); }