Bug 928381 - ctypes/libffi: Fix stack alignment on *BSD/i386 r=glandium
authorLandry Breuil <landry@openbsd.org>
Mon, 04 Nov 2013 22:05:46 +0100
changeset 153379 96420ca4720053c24f9570dca5cd932acc00e22e
parent 153378 4f259397bfb9ba9235c39589932ad8286a215415
child 153380 7b9765059205a3ed02c49ccf64bade2cabc15da0
push id35794
push userlandry@openbsd.org
push dateMon, 04 Nov 2013 21:09:22 +0000
treeherdermozilla-inbound@7b9765059205 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs928381
milestone28.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 928381 - ctypes/libffi: Fix stack alignment on *BSD/i386 r=glandium
js/src/ctypes/libffi/src/x86/freebsd.S
js/src/ctypes/patches-libffi/07-bug-928381.patch
--- a/js/src/ctypes/libffi/src/x86/freebsd.S
+++ b/js/src/ctypes/libffi/src/x86/freebsd.S
@@ -44,16 +44,19 @@ ffi_call_SYSV:
         pushl %ebp
 .LCFI0:
         movl  %esp,%ebp
 .LCFI1:
 	/* Make room for all of the new args.  */
 	movl  16(%ebp),%ecx
 	subl  %ecx,%esp
 
+	/* Align the stack pointer to 16-bytes */
+	andl  $0xfffffff0, %esp
+
 	movl  %esp,%eax
 
 	/* Place all of the ffi_prep_args in position  */
 	pushl 12(%ebp)
 	pushl %eax
 	call  *8(%ebp)
 
 	/* Return stack to previous state and call the function  */
new file mode 100644
--- /dev/null
+++ b/js/src/ctypes/patches-libffi/07-bug-928381.patch
@@ -0,0 +1,31 @@
+# HG changeset patch
+# User Landry Breuil <landry@openbsd.org>
+# Date 1382105758 -7200
+#      Fri Oct 18 16:15:58 2013 +0200
+# Node ID 5f82dae8c495a7fddf5ed935eb2a8be7f47b9bd8
+# Parent  d50df2233e95f4d45b35eddbfbe84bcdda6a11e2
+Bug 928381 - ctypes/libffi: Fix stack alignment on *BSD/i386 r=glandium
+
+diff --git a/js/src/ctypes/libffi/src/x86/freebsd.S b/js/src/ctypes/libffi/src/x86/freebsd.S
+--- a/js/src/ctypes/libffi/src/x86/freebsd.S
++++ b/js/src/ctypes/libffi/src/x86/freebsd.S
+@@ -44,16 +44,19 @@ ffi_call_SYSV:
+         pushl %ebp
+ .LCFI0:
+         movl  %esp,%ebp
+ .LCFI1:
+ 	/* Make room for all of the new args.  */
+ 	movl  16(%ebp),%ecx
+ 	subl  %ecx,%esp
+ 
++	/* Align the stack pointer to 16-bytes */
++	andl  $0xfffffff0, %esp
++
+ 	movl  %esp,%eax
+ 
+ 	/* Place all of the ffi_prep_args in position  */
+ 	pushl 12(%ebp)
+ 	pushl %eax
+ 	call  *8(%ebp)
+ 
+ 	/* Return stack to previous state and call the function  */