@@ -113,7 +113,9 @@ impl Drop for Bomb {
113113
114114#[ inline( always) ]
115115pub unsafe fn trace ( mut cb : & mut dyn FnMut ( & super :: Frame ) -> bool ) {
116- uw:: _Unwind_Backtrace ( trace_fn, addr_of_mut ! ( cb) . cast ( ) ) ;
116+ unsafe {
117+ uw:: _Unwind_Backtrace ( trace_fn, addr_of_mut ! ( cb) . cast ( ) ) ;
118+ }
117119
118120 extern "C" fn trace_fn (
119121 ctx : * mut uw:: _Unwind_Context ,
@@ -209,7 +211,7 @@ mod uw {
209211 extern "C" {
210212 pub fn _Unwind_GetGR( ctx: * mut _Unwind_Context, index: libc:: c_int) -> libc:: uintptr_t;
211213 }
212- _Unwind_GetGR( ctx, 15 )
214+ unsafe { _Unwind_GetGR( ctx, 15 ) }
213215 }
214216 } else {
215217 use core:: ptr:: addr_of_mut;
@@ -259,13 +261,15 @@ mod uw {
259261 pub unsafe fn _Unwind_GetIP( ctx: * mut _Unwind_Context) -> libc:: uintptr_t {
260262 let mut val: _Unwind_Word = 0 ;
261263 let ptr = addr_of_mut!( val) ;
262- let _ = _Unwind_VRS_Get(
263- ctx,
264- _Unwind_VRS_RegClass:: _UVRSC_CORE,
265- 15 ,
266- _Unwind_VRS_DataRepresentation:: _UVRSD_UINT32,
267- ptr. cast:: <c_void>( ) ,
268- ) ;
264+ unsafe {
265+ let _ = _Unwind_VRS_Get(
266+ ctx,
267+ _Unwind_VRS_RegClass:: _UVRSC_CORE,
268+ 15 ,
269+ _Unwind_VRS_DataRepresentation:: _UVRSD_UINT32,
270+ ptr. cast:: <c_void>( ) ,
271+ ) ;
272+ }
269273 ( val & !1 ) as libc:: uintptr_t
270274 }
271275
@@ -275,13 +279,15 @@ mod uw {
275279 pub unsafe fn get_sp( ctx: * mut _Unwind_Context) -> libc:: uintptr_t {
276280 let mut val: _Unwind_Word = 0 ;
277281 let ptr = addr_of_mut!( val) ;
278- let _ = _Unwind_VRS_Get(
279- ctx,
280- _Unwind_VRS_RegClass:: _UVRSC_CORE,
281- SP ,
282- _Unwind_VRS_DataRepresentation:: _UVRSD_UINT32,
283- ptr. cast:: <c_void>( ) ,
284- ) ;
282+ unsafe {
283+ let _ = _Unwind_VRS_Get(
284+ ctx,
285+ _Unwind_VRS_RegClass:: _UVRSC_CORE,
286+ SP ,
287+ _Unwind_VRS_DataRepresentation:: _UVRSD_UINT32,
288+ ptr. cast:: <c_void>( ) ,
289+ ) ;
290+ }
285291 val as libc:: uintptr_t
286292 }
287293
0 commit comments