diff options
| author | Ben Kimock <kimockb@gmail.com> | 2024-03-15 14:13:11 -0400 |
|---|---|---|
| committer | Ben Kimock <kimockb@gmail.com> | 2024-03-16 15:22:05 -0400 |
| commit | e46114fdc880cded537697a25ba0cf04f242ca82 (patch) | |
| tree | 2671b4b4e4ea968cf9c44c250c3a3b944ae1d57d /src/base.rs | |
| parent | 47abd3a4862b172d059d03a87b3f2522d6bd6958 (diff) | |
Handle calls to upstream monomorphizations in compiler_builtins
Diffstat (limited to 'src/base.rs')
| -rw-r--r-- | src/base.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/base.rs b/src/base.rs index 2415c2c90b2..047dc56a32e 100644 --- a/src/base.rs +++ b/src/base.rs @@ -8,6 +8,7 @@ use rustc_index::IndexVec; use rustc_middle::ty::adjustment::PointerCoercion; use rustc_middle::ty::layout::FnAbiOf; use rustc_middle::ty::print::with_no_trimmed_paths; +use rustc_monomorphize::is_call_from_compiler_builtins_to_upstream_monomorphization; use crate::constant::ConstantCx; use crate::debuginfo::FunctionDebugContext; @@ -999,6 +1000,12 @@ fn codegen_panic_inner<'tcx>( let def_id = fx.tcx.require_lang_item(lang_item, span); let instance = Instance::mono(fx.tcx, def_id).polymorphize(fx.tcx); + + if is_call_from_compiler_builtins_to_upstream_monomorphization(fx.tcx, instance) { + fx.bcx.ins().trap(TrapCode::User(0)); + return; + } + let symbol_name = fx.tcx.symbol_name(instance).name; fx.lib_call( |
