diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs index ad5c6e42d9e..aff2b443a23 100644 --- a/lib/vm/src/trap/traphandlers.rs +++ b/lib/vm/src/trap/traphandlers.rs @@ -340,8 +340,14 @@ cfg_if::cfg_if! { Some(info) => info, None => return EXCEPTION_CONTINUE_SEARCH, }; + #[cfg(target_pointer_width = "32")] + let pc = (*(*exception_info).ContextRecord).Eip as *const u8; + + #[cfg(target_pointer_width = "64")] + let pc = (*(*exception_info).ContextRecord).Rip as *const u8; + let jmp_buf = info.handle_trap( - (*(*exception_info).ContextRecord).Rip as *const u8, + pc, record.ExceptionCode == EXCEPTION_STACK_OVERFLOW, // TODO: fix the signal trap associated to memory access in Windows None,