Force self to sub/add rsp before/after push/pop (instead of after/before push/pop) -- prevents popping wrong values, eventually (in callee, like what printf does)

This commit is contained in:
2025-07-10 01:38:25 +02:00
parent 2d1a4b9d56
commit 3951e50ab0

View File

@@ -168,10 +168,10 @@ printf:
.d_fromStack:
mov rsi, [rbp + RBP_OFFSET_CALLER + ((rdx-5) * SIZE_QWORD)]
.checkINTorUINT:
sub rsp, SIZE_QWORD
push rax
push rdx
push rdi
sub rsp, SIZE_QWORD
cmp byte [rdi + 1], 'u'
je .callUINT2STR
mov rdi, rsi
@@ -182,10 +182,10 @@ printf:
call udec2str
.loadConvertedStr:
mov rsi, rax
add rsp, SIZE_QWORD
pop rdi
pop rdx
pop rax
add rsp, SIZE_QWORD
jmp .insertString
;--- '%x' / '%X' ---;