mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
context.asm: zero rbp on stack change
This commit is contained in:
@@ -82,6 +82,12 @@ arch_context_saveandcall:
|
|||||||
push qword 0 ; GS
|
push qword 0 ; GS
|
||||||
sub rsp, 8 ; cr2
|
sub rsp, 8 ; cr2
|
||||||
|
|
||||||
|
test rsi, rsi
|
||||||
|
jz .nostackchange2
|
||||||
|
|
||||||
|
xor rbp, rbp ; the old stack will no longer be in our ownership, so zero rbp
|
||||||
|
|
||||||
|
.nostackchange2:
|
||||||
mov r11, rdi ; save function to call
|
mov r11, rdi ; save function to call
|
||||||
mov rdi, rsp ; first argument is the context struct
|
mov rdi, rsp ; first argument is the context struct
|
||||||
mov rsi, rdx ; pass argument
|
mov rsi, rdx ; pass argument
|
||||||
|
|||||||
Reference in New Issue
Block a user