From b3a98824664b62d2f3faf2cb2146cfa176090377 Mon Sep 17 00:00:00 2001 From: whitequark Date: Tue, 28 Apr 2020 13:13:42 +0000 Subject: [PATCH] Add X86-32 support to wasm-runtime trap handler. --- crates/runtime/src/traphandlers.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/runtime/src/traphandlers.rs b/crates/runtime/src/traphandlers.rs index 9ec38ba872..aaf6f8a586 100644 --- a/crates/runtime/src/traphandlers.rs +++ b/crates/runtime/src/traphandlers.rs @@ -158,6 +158,9 @@ cfg_if::cfg_if! { if #[cfg(all(target_os = "linux", target_arch = "x86_64"))] { let cx = &*(cx as *const libc::ucontext_t); 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"))] { // libc doesn't seem to support Linux/aarch64 at the moment? extern "C" {