Add X86-32 support to wasm-runtime trap handler.

This commit is contained in:
whitequark
2020-04-28 13:13:42 +00:00
committed by iximeow
parent 0bc0503f3f
commit b3a9882466

View File

@@ -158,6 +158,9 @@ cfg_if::cfg_if! {
if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] { if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] {
let cx = &*(cx as *const libc::ucontext_t); let cx = &*(cx as *const libc::ucontext_t);
cx.uc_mcontext.gregs[libc::REG_RIP as usize] as *const u8 cx.uc_mcontext.gregs[libc::REG_RIP as usize] as *const u8
} else if #[cfg(all(target_os = "linux", target_arch = "x86"))] {
let cx = &*(cx as *const libc::ucontext_t);
cx.uc_mcontext.gregs[libc::REG_EIP as usize] as *const u8
} else if #[cfg(all(target_os = "linux", target_arch = "aarch64"))] { } else if #[cfg(all(target_os = "linux", target_arch = "aarch64"))] {
// libc doesn't seem to support Linux/aarch64 at the moment? // libc doesn't seem to support Linux/aarch64 at the moment?
extern "C" { extern "C" {