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:
Scott Ehlert 2013-05-27 03:24:15 -05:00
parent 4f768ad326
commit 1c7d8ab157
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
%assign stkspace %1
mov ebp, esp
and esp, 0xFFFFFFF0 and esp, 0xFFFFFFF0
sub esp, %1 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