Skip to content

Commit 8d374b1

Browse files
committed
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: llvm/llvm-project#83040
1 parent adf57a7 commit 8d374b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ static void BadAllocErrorHandler(void *UserData,
110110
}
111111

112112
extern "C" void LLVMRustInstallErrorHandlers() {
113-
install_fatal_error_handler(FatalErrorHandler);
114113
install_bad_alloc_error_handler(BadAllocErrorHandler);
114+
install_fatal_error_handler(FatalErrorHandler);
115115
install_out_of_memory_new_handler();
116116
}
117117

0 commit comments

Comments
 (0)