@@ -57,7 +57,7 @@ impl<'c, Param, Yield, Return> Coroutine<'c, Param, Yield, Return> {
5757 any( target_os = "linux" , target_os = "android" ) ,
5858 target_arch = "x86" ,
5959 ) ) ] {
60- let sp = u64 :: from( std:: mem :: transmute :: <_ , std :: ffi:: c_uint> ( context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_ESP ) . expect( "overflow" ) ] ) ) ;
60+ let sp = u64 :: from( std:: ffi:: c_uint:: from_ne_bytes ( context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_ESP ) . expect( "overflow" ) ] . to_ne_bytes ( ) ) ) ;
6161 } else if #[ cfg( all( target_vendor = "apple" , target_arch = "x86_64" ) ) ] {
6262 let sp = u64 :: try_from( ( * context. uc_mcontext) . __ss. __rsp) . expect( "overflow" ) ;
6363 } else if #[ cfg( all(
@@ -108,11 +108,11 @@ impl<'c, Param, Yield, Return> Coroutine<'c, Param, Yield, Return> {
108108 target_arch = "x86" ,
109109 ) ) ] {
110110 let TrapHandlerRegs { eip, esp, ebp, ecx, edx } = regs;
111- context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_EIP ) . expect( "overflow" ) ] = std :: mem :: transmute ( eip) ;
112- context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_ESP ) . expect( "overflow" ) ] = std :: mem :: transmute ( esp) ;
113- context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_EBP ) . expect( "overflow" ) ] = std :: mem :: transmute ( ebp) ;
114- context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_ECX ) . expect( "overflow" ) ] = std :: mem :: transmute ( ecx) ;
115- context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_EDX ) . expect( "overflow" ) ] = std :: mem :: transmute ( edx) ;
111+ context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_EIP ) . expect( "overflow" ) ] = i32 :: from_ne_bytes ( eip. to_ne_bytes ( ) ) ;
112+ context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_ESP ) . expect( "overflow" ) ] = i32 :: from_ne_bytes ( esp. to_ne_bytes ( ) ) ;
113+ context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_EBP ) . expect( "overflow" ) ] = i32 :: from_ne_bytes ( ebp. to_ne_bytes ( ) ) ;
114+ context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_ECX ) . expect( "overflow" ) ] = i32 :: from_ne_bytes ( ecx. to_ne_bytes ( ) ) ;
115+ context. uc_mcontext. gregs[ usize :: try_from( libc:: REG_EDX ) . expect( "overflow" ) ] = i32 :: from_ne_bytes ( edx. to_ne_bytes ( ) ) ;
116116 } else if #[ cfg( all( target_vendor = "apple" , target_arch = "x86_64" ) ) ] {
117117 let TrapHandlerRegs { rip, rsp, rbp, rdi, rsi } = regs;
118118 ( * context. uc_mcontext) . __ss. __rip = rip;
0 commit comments