This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2] Fix problems in MASM version of ffi_closure_raw_THISCALL


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]