mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 14:25:38 +03:00
Fixed crash regression in JIT compiler (r=dvander).
This regression was caused by the 16-byte stack alignment chageset: 5cb8a336b05c
This commit is contained in:
parent
4f768ad326
commit
1c7d8ab157
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -308,18 +308,28 @@
|
|||||||
|
|
||||||
%macro _STK_ALIGN 1 ; align stack to 16-byte boundary and
|
%macro _STK_ALIGN 1 ; align stack to 16-byte boundary and
|
||||||
; allocate %1 bytes of stack space
|
; allocate %1 bytes of stack space
|
||||||
|
; top of stack allocation will hold original esp
|
||||||
%if %1 % 16 != 0
|
%if %1 % 16 != 0
|
||||||
%error "expected 16-byte aligned value"
|
%error "expected 16-byte aligned value"
|
||||||
%endif
|
%endif
|
||||||
push edi
|
|
||||||
mov edi, esp
|
%push stkalign
|
||||||
and esp, 0xFFFFFFF0
|
%assign stkspace %1
|
||||||
sub esp, %1
|
|
||||||
|
mov ebp, esp
|
||||||
|
and esp, 0xFFFFFFF0
|
||||||
|
sub esp, %1
|
||||||
|
mov [esp+%1-4], ebp
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
%macro _STK_RESTORE 0 ; restore stack pointer after 16-byte alignment
|
%macro _STK_RESTORE 0 ; restore stack pointer after 16-byte alignment
|
||||||
mov esp, edi
|
%ifnctx stkalign
|
||||||
pop edi
|
%fatal "expected _STK_ALIGN before _STK_RESTORE"
|
||||||
|
%endif
|
||||||
|
|
||||||
|
mov esp, [esp+stkspace-4]
|
||||||
|
|
||||||
|
%pop stkalign
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
global asm_runJIT, _asm_runJIT
|
global asm_runJIT, _asm_runJIT
|
||||||
|
Loading…
Reference in New Issue
Block a user