diff options
Diffstat (limited to 'runtime/arch')
-rw-r--r-- | runtime/arch/x86/context_x86.cc | 2 | ||||
-rw-r--r-- | runtime/arch/x86_64/context_x86_64.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/runtime/arch/x86/context_x86.cc b/runtime/arch/x86/context_x86.cc index 37049cf..a7beaa9 100644 --- a/runtime/arch/x86/context_x86.cc +++ b/runtime/arch/x86/context_x86.cc @@ -81,7 +81,7 @@ void X86Context::DoLongJump() { gprs[kNumberOfCpuRegisters - i - 1] = gprs_[i] != nullptr ? *gprs_[i] : X86Context::kBadGprBase + i; } // We want to load the stack pointer one slot below so that the ret will pop eip. - uintptr_t esp = gprs[kNumberOfCpuRegisters - ESP - 1] - kWordSize; + uintptr_t esp = gprs[kNumberOfCpuRegisters - ESP - 1] - sizeof(intptr_t); gprs[kNumberOfCpuRegisters] = esp; *(reinterpret_cast<uintptr_t*>(esp)) = eip_; __asm__ __volatile__( diff --git a/runtime/arch/x86_64/context_x86_64.cc b/runtime/arch/x86_64/context_x86_64.cc index 7699eaf..79d0666 100644 --- a/runtime/arch/x86_64/context_x86_64.cc +++ b/runtime/arch/x86_64/context_x86_64.cc @@ -129,7 +129,7 @@ void X86_64Context::DoLongJump() { } // We want to load the stack pointer one slot below so that the ret will pop eip. - uintptr_t rsp = gprs[kNumberOfCpuRegisters - RSP - 1] - kWordSize; + uintptr_t rsp = gprs[kNumberOfCpuRegisters - RSP - 1] - sizeof(intptr_t); gprs[kNumberOfCpuRegisters] = rsp; *(reinterpret_cast<uintptr_t*>(rsp)) = rip_; |