diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-03-17 08:23:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-17 08:23:26 +0100 |
| commit | 33b4ed225a1d6b9f1b3bb25d1f0b0c7254dd1553 (patch) | |
| tree | 7e492337fe0420f6cf2d07eb740963fb195ca81c /compiler/rustc_codegen_llvm/src | |
| parent | ea0745604f1ff03f97e61af234bd56ffb193ea07 (diff) | |
| parent | 8d374b1f2af876423435e47b66c01cd6fa38aaa1 (diff) | |
| download | rust-33b4ed225a1d6b9f1b3bb25d1f0b0c7254dd1553.tar.gz rust-33b4ed225a1d6b9f1b3bb25d1f0b0c7254dd1553.zip | |
Rollup merge of #122574 - cuviper:llvm-oom, r=nikic
Register LLVM handlers for bad-alloc / OOM LLVM's default bad-alloc handler may throw if exceptions are enabled, and `operator new` isn't hooked at all by default. Now we register our own handler that prints a message similar to fatal errors, then aborts. We also call the function that registers the C++ `std::new_handler`. Fixes #121305 Cc llvm/llvm-project#85281 r? ``@nikic``
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm_util.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index d34c289887e..284bc74d5c4 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -1519,7 +1519,7 @@ extern "C" { #[link(name = "llvm-wrapper", kind = "static")] extern "C" { - pub fn LLVMRustInstallFatalErrorHandler(); + pub fn LLVMRustInstallErrorHandlers(); pub fn LLVMRustDisableSystemDialogsOnCrash(); // Create and destroy contexts. diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs index e32c38644aa..c9e62e504ae 100644 --- a/compiler/rustc_codegen_llvm/src/llvm_util.rs +++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs @@ -49,7 +49,7 @@ unsafe fn configure_llvm(sess: &Session) { let mut llvm_c_strs = Vec::with_capacity(n_args + 1); let mut llvm_args = Vec::with_capacity(n_args + 1); - llvm::LLVMRustInstallFatalErrorHandler(); + llvm::LLVMRustInstallErrorHandlers(); // On Windows, an LLVM assertion will open an Abort/Retry/Ignore dialog // box for the purpose of launching a debugger. However, on CI this will // cause it to hang until it times out, which can take several hours. |
