diff options
| author | Josh Stone <jistone@redhat.com> | 2024-03-15 16:49:08 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2024-03-15 16:49:08 -0700 |
| commit | 8d374b1f2af876423435e47b66c01cd6fa38aaa1 (patch) | |
| tree | c3ce239038d45bdbf864634da91bfa3e2c8ea644 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | adf57a75d5014b620f2c09587b6e1e108a7622da (diff) | |
| download | rust-8d374b1f2af876423435e47b66c01cd6fa38aaa1.tar.gz rust-8d374b1f2af876423435e47b66c01cd6fa38aaa1.zip | |
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
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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(); } |
