Skip to content

Commit 3f5a829

Browse files
committed
[HACK]
1 parent e3b3b24 commit 3f5a829

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/abi/mod.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,21 @@ pub(crate) fn get_function_sig<'tcx>(
7979
default_call_conv: CallConv,
8080
inst: Instance<'tcx>,
8181
) -> Signature {
82+
// FIXME remove this hack
83+
if tcx.symbol_name(inst).name == "rust_eh_personality" {
84+
return Signature {
85+
params: vec![
86+
AbiParam::new(types::I32),
87+
AbiParam::new(types::I32),
88+
AbiParam::new(types::I64),
89+
AbiParam::new(types::I64 /* FIXME fx.pointer_type */),
90+
AbiParam::new(types::I64 /* FIXME fx.pointer_type */),
91+
],
92+
returns: vec![AbiParam::new(types::I32)],
93+
call_conv: default_call_conv,
94+
};
95+
}
96+
8297
assert!(!inst.args.has_infer());
8398
clif_sig_from_fn_abi(
8499
tcx,
@@ -299,7 +314,10 @@ pub(crate) fn codegen_fn_prelude<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, start_
299314
}
300315

301316
assert!(arg_abis_iter.next().is_none(), "ArgAbi left behind");
302-
assert!(block_params_iter.next().is_none(), "arg_value left behind");
317+
// FIXME remove hack
318+
if fx.symbol_name != "rust_eh_personality" {
319+
assert!(block_params_iter.next().is_none(), "arg_value left behind");
320+
}
303321

304322
self::comments::add_locals_header_comment(fx);
305323

src/debuginfo/unwind.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ impl UnwindContext {
3838
gimli::DW_EH_PE_absptr
3939
};
4040

41+
// FIXME only add personality function and lsda when necessary: https://github.com/rust-lang/rust/blob/1f76d219c906f0112bb1872f33aa977164c53fa6/compiler/rustc_codegen_ssa/src/mir/mod.rs#L200-L204
42+
4143
cie.fde_address_encoding = ptr_encoding;
4244

4345
// FIXME only add personality function and lsda when necessary: https://github.com/rust-lang/rust/blob/1f76d219c906f0112bb1872f33aa977164c53fa6/compiler/rustc_codegen_ssa/src/mir/mod.rs#L200-L204

0 commit comments

Comments
 (0)