Fix x86 setjmp/longjmp
This commit is contained in:
@@ -4,17 +4,13 @@
|
||||
.type longjmp,@function
|
||||
_longjmp:
|
||||
longjmp:
|
||||
mov 4(%esp),%edx
|
||||
mov 8(%esp),%eax
|
||||
test %eax,%eax
|
||||
jnz 1f
|
||||
inc %eax
|
||||
1:
|
||||
mov (%edx),%ebx
|
||||
mov 4(%edx),%esi
|
||||
mov 8(%edx),%edi
|
||||
mov 12(%edx),%ebp
|
||||
mov 16(%edx),%ecx
|
||||
mov %ecx,%esp
|
||||
mov 20(%edx),%ecx
|
||||
jmp *%ecx
|
||||
mov edx, [esp + 4]
|
||||
mov eax, [esp + 8]
|
||||
cmp eax, 1
|
||||
adc al, 0
|
||||
mov ebx, [edx]
|
||||
mov esi, [edx + 4]
|
||||
mov edi, [edx + 8]
|
||||
mov ebp, [edx + 12]
|
||||
mov esp, [edx + 16]
|
||||
jmp [edx + 20]
|
||||
|
||||
@@ -10,14 +10,14 @@ ___setjmp:
|
||||
__setjmp:
|
||||
_setjmp:
|
||||
setjmp:
|
||||
mov 4(%esp), %eax
|
||||
mov %ebx, (%eax)
|
||||
mov %esi, 4(%eax)
|
||||
mov %edi, 8(%eax)
|
||||
mov %ebp, 12(%eax)
|
||||
lea 4(%esp), %ecx
|
||||
mov %ecx, 16(%eax)
|
||||
mov (%esp), %ecx
|
||||
mov %ecx, 20(%eax)
|
||||
xor %eax, %eax
|
||||
mov eax, [esp + 4]
|
||||
mov [eax], ebx
|
||||
mov [eax + 4], esi
|
||||
mov [eax + 8], edi
|
||||
mov [eax + 12], ebp
|
||||
lea ecx, [esp + 4]
|
||||
mov [eax + 16], ecx
|
||||
mov ecx, [esp]
|
||||
mov [eax + 20], ecx
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
Reference in New Issue
Block a user