This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
[PATCH 2/2] Fix problems in MASM version of ffi_closure_raw_THISCALL
- From: Peter Rosin <peda at lysator dot liu dot se>
- To: libffi-discuss at sourceware dot org
- Cc: Peter Rosin <peda at lysator dot liu dot se>
- Date: Thu, 29 Mar 2012 20:09:07 +0200
- Subject: [PATCH 2/2] Fix problems in MASM version of ffi_closure_raw_THISCALL
- References: <1333044547-8348-1-git-send-email-peda@lysator.liu.se>
---
ChangeLog | 6 ++++++
src/x86/win32.S | 9 +++------
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index dcee8ef..6f1fda6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2012-03-29 Peter Rosin <peda@lysator.liu.se>
+ * src/x86/win32.S (ffi_closure_raw_THISCALL): Unify the frame
+ generation, fix the ENDP label and remove the surplus third arg
+ from the 'lea' insn.
+
+2012-03-29 Peter Rosin <peda@lysator.liu.se>
+
* src/x86/win32.S (ffi_closure_raw_SYSV): Make the 'stubraw' label
visible outside the PROC, so that ffi_closure_raw_THISCALL can see
it. Also instruct the assembler to add a frame to the function.
diff --git a/src/x86/win32.S b/src/x86/win32.S
index 7d8653e..877170f 100644
--- a/src/x86/win32.S
+++ b/src/x86/win32.S
@@ -264,17 +264,14 @@ ffi_closure_SYSV ENDP
#define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
#define CIF_FLAGS_OFFSET 20
-ffi_closure_raw_THISCALL PROC NEAR
- push ebp
- mov ebp, esp
- push esi
+ffi_closure_raw_THISCALL PROC NEAR USES esi FORCEFRAME
sub esp, 36
mov esi, [eax + RAW_CLOSURE_CIF_OFFSET] ;; closure->cif
mov edx, [eax + RAW_CLOSURE_USER_DATA_OFFSET] ;; closure->user_data
mov [esp + 12], edx
- lea edx, [ebp + 12], edx
+ lea edx, [ebp + 12]
jmp stubraw
-ffi_closure_raw_SYSV ENDP
+ffi_closure_raw_THISCALL ENDP
ffi_closure_raw_SYSV PROC NEAR USES esi FORCEFRAME
;; the ffi_closure ctx is passed in eax by the trampoline.
--
1.7.9