diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-06-15 17:56:01 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-06-15 17:56:01 +0000 |
| commit | 82b497286d209b50f939ecb4f16dc1e72fcfda95 (patch) | |
| tree | fc39aff3da7ab89bad516b92950ce3ea1b67336f /compiler/rustc_codegen_cranelift/src/trap.rs | |
| parent | f9097f87c9c094f80826fb60a1a624b5f9f1ed82 (diff) | |
| parent | 8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807 (diff) | |
| download | rust-82b497286d209b50f939ecb4f16dc1e72fcfda95.tar.gz rust-82b497286d209b50f939ecb4f16dc1e72fcfda95.zip | |
Merge commit '8830dccd1d4c74f1f69b0d3bd982a3f1fcde5807' into sync_cg_clif-2023-06-15
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/trap.rs')
| -rw-r--r-- | compiler/rustc_codegen_cranelift/src/trap.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/trap.rs b/compiler/rustc_codegen_cranelift/src/trap.rs index 82a2ec57954..2fb0c2164c3 100644 --- a/compiler/rustc_codegen_cranelift/src/trap.rs +++ b/compiler/rustc_codegen_cranelift/src/trap.rs @@ -30,5 +30,9 @@ fn codegen_print(fx: &mut FunctionCx<'_, '_, '_>, msg: &str) { /// Trap code: user65535 pub(crate) fn trap_unimplemented(fx: &mut FunctionCx<'_, '_, '_>, msg: impl AsRef<str>) { codegen_print(fx, msg.as_ref()); + + let one = fx.bcx.ins().iconst(types::I32, 1); + fx.lib_call("exit", vec![AbiParam::new(types::I32)], vec![], &[one]); + fx.bcx.ins().trap(TrapCode::User(!0)); } |
