Bugfix of issue #2575

Bugfix of issue #2575.

Use libc 0.2.82 on aarch64-apple-darwin Apple Silicon, and local test passes.
This commit is contained in:
Han Zhao
2021-01-19 17:08:11 +01:00
committed by GitHub
parent c7de8f5efb
commit f8268b2139

View File

@@ -164,9 +164,15 @@ cfg_if::cfg_if! {
} else if #[cfg(all(any(target_os = "linux", target_os = "android"), target_arch = "aarch64"))] { } else if #[cfg(all(any(target_os = "linux", target_os = "android"), target_arch = "aarch64"))] {
let cx = &*(cx as *const libc::ucontext_t); let cx = &*(cx as *const libc::ucontext_t);
cx.uc_mcontext.pc as *const u8 cx.uc_mcontext.pc as *const u8
} else if #[cfg(target_os = "macos")] { } else if #[cfg(all(target_os = "macos", target_arch = "x86_64"))] {
let cx = &*(cx as *const libc::ucontext_t); let cx = &*(cx as *const libc::ucontext_t);
(*cx.uc_mcontext).__ss.__rip as *const u8 (*cx.uc_mcontext).__ss.__rip as *const u8
} else if #[cfg(all(target_os = "macos", target_arch = "x86"))] {
let cx = &*(cx as *const libc::ucontext_t);
(*cx.uc_mcontext).__ss.__eip as *const u8
} else if #[cfg(all(target_os = "macos", target_arch = "aarch64"))] {
let cx = &*(cx as *const libc::ucontext_t);
(*cx.uc_mcontext).__ss.__pc as *const u8
} else if #[cfg(all(target_os = "freebsd", target_arch = "x86_64"))] { } else if #[cfg(all(target_os = "freebsd", target_arch = "x86_64"))] {
let cx = &*(cx as *const libc::ucontext_t); let cx = &*(cx as *const libc::ucontext_t);
cx.uc_mcontext.mc_rip as *const u8 cx.uc_mcontext.mc_rip as *const u8