diff --git a/test/sys/test_ptrace.rs b/test/sys/test_ptrace.rs index c99c6762c3..3914921b69 100644 --- a/test/sys/test_ptrace.rs +++ b/test/sys/test_ptrace.rs @@ -224,12 +224,16 @@ fn test_ptrace_syscall() { .unwrap(); #[cfg(target_arch = "x86_64")] - let get_syscall_id = - || ptrace::getregs(child).unwrap().orig_rax as libc::c_long; + let get_syscall_id = || { + unsafe { ptrace::getregs(child) }.unwrap().orig_rax + as libc::c_long + }; #[cfg(target_arch = "x86")] - let get_syscall_id = - || ptrace::getregs(child).unwrap().orig_eax as libc::c_long; + let get_syscall_id = || { + unsafe { ptrace::getregs(child) }.unwrap().orig_eax + as libc::c_long + }; #[cfg(target_arch = "aarch64")] let get_syscall_id =