Skip to content

Commit 157ce6c

Browse files
committed
[HACK]
1 parent c996cd7 commit 157ce6c

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,
@@ -303,7 +318,10 @@ pub(crate) fn codegen_fn_prelude<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, start_
303318
}
304319

305320
assert!(arg_abis_iter.next().is_none(), "ArgAbi left behind");
306-
assert!(block_params_iter.next().is_none(), "arg_value left behind");
321+
// FIXME remove hack
322+
if fx.symbol_name != "rust_eh_personality" {
323+
assert!(block_params_iter.next().is_none(), "arg_value left behind");
324+
}
307325

308326
self::comments::add_locals_header_comment(fx);
309327

src/debuginfo/unwind.rs

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

42+
// 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
43+
4244
cie.fde_address_encoding = ptr_encoding;
4345

4446
// 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)