diff --git a/src/panicking.rs b/src/panicking.rs index 24da451..9c83bfe 100644 --- a/src/panicking.rs +++ b/src/panicking.rs @@ -21,7 +21,7 @@ pub fn begin_panic(exception: E) -> UnwindReasonCode { unsafe { (*ex).exception_class = u64::from_be_bytes(E::CLASS); (*ex).exception_cleanup = Some(exception_cleanup::); - _Unwind_RaiseException(&mut *ex) + _Unwind_RaiseException(ex) } } diff --git a/src/personality.rs b/src/personality.rs index 2dda30a..3bbdb16 100644 --- a/src/personality.rs +++ b/src/personality.rs @@ -136,11 +136,11 @@ fn find_eh_action( } #[lang = "eh_personality"] -fn rust_eh_personality( +unsafe fn rust_eh_personality( version: c_int, actions: UnwindAction, _exception_class: u64, - exception: &mut UnwindException, + exception: *mut UnwindException, unwind_ctx: &mut UnwindContext<'_>, ) -> UnwindReasonCode { if version != 1 { @@ -170,7 +170,7 @@ fn rust_eh_personality( _Unwind_SetGR( unwind_ctx, Arch::UNWIND_DATA_REG.0 .0 as _, - exception as *mut _ as usize, + exception as usize, ); _Unwind_SetGR(unwind_ctx, Arch::UNWIND_DATA_REG.1 .0 as _, 0); _Unwind_SetIP(unwind_ctx, lpad); diff --git a/src/personality_dummy.rs b/src/personality_dummy.rs index 8d9465a..ff026c7 100644 --- a/src/personality_dummy.rs +++ b/src/personality_dummy.rs @@ -2,11 +2,11 @@ use crate::abi::*; use crate::util::*; #[lang = "eh_personality"] -extern "C" fn personality( +unsafe extern "C" fn personality( version: c_int, _actions: UnwindAction, _exception_class: u64, - _exception: &mut UnwindException, + _exception: *mut UnwindException, _ctx: &mut UnwindContext<'_>, ) -> UnwindReasonCode { if version != 1 {