Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #2389. Replace Rip with Eip for windows #2390

Merged
merged 2 commits into from
Jun 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/vm/src/trap/traphandlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down