context.asm: zero rbp on stack change

This commit is contained in:
Matheus
2025-12-07 12:06:32 -03:00
parent 1a7a178168
commit 227fcb5386
+6
View File
@@ -82,6 +82,12 @@ arch_context_saveandcall:
push qword 0 ; GS
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 rdi, rsp ; first argument is the context struct
mov rsi, rdx ; pass argument