diff options
| author | Josh Stone <jistone@redhat.com> | 2024-03-15 15:49:06 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2024-03-15 15:49:06 -0700 |
| commit | 0ade5a11f5705e33e031ae5b47c21fd0553d6675 (patch) | |
| tree | f07ea4cb148065fb06b8818ecff90be3ce57336b /compiler/rustc_codegen_llvm/src/llvm/ffi.rs | |
| parent | 1ca424ca436d4d4449def39723c9ec442837c370 (diff) | |
| download | rust-0ade5a11f5705e33e031ae5b47c21fd0553d6675.tar.gz rust-0ade5a11f5705e33e031ae5b47c21fd0553d6675.zip | |
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`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm/ffi.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 2 |
1 files changed, 1 insertions, 1 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. |
