Fixed crash regression in JIT compiler (r=dvander).

This regression was caused by the 16-byte stack alignment chageset: 5cb8a336b05c


Former-commit-id: 1c7d8ab157e562368d1c4e16cecd0da6f90df468
This commit is contained in:
Scott Ehlert 2013-05-27 03:24:15 -05:00
parent d010b126cd
commit 950ef59319
4 changed files with 16 additions and 6 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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