From 8d374b1f2af876423435e47b66c01cd6fa38aaa1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 15 Mar 2024 16:49:08 -0700 Subject: Install the bad-alloc handler before fatal errors The bad-alloc installer was incorrectly asserting that the other handler isn't set yet, instead of checking its own, but we can avoid that by changing the order we install them. Ref: https://github.com/llvm/llvm-project/issues/83040 --- compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp') diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp index 861c0a6e79a..91f54da5c12 100644 --- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp @@ -110,8 +110,8 @@ static void BadAllocErrorHandler(void *UserData, } extern "C" void LLVMRustInstallErrorHandlers() { - install_fatal_error_handler(FatalErrorHandler); install_bad_alloc_error_handler(BadAllocErrorHandler); + install_fatal_error_handler(FatalErrorHandler); install_out_of_memory_new_handler(); } -- cgit 1.4.1-3-g733a5