about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2011-11-10 12:32:06 -0800
committerNiko Matsakis <niko@alum.mit.edu>2011-11-16 15:16:40 -0800
commit3617f0377fb797ada3a20addb9e9a24e4b8a4f43 (patch)
tree4e751c9fe20727c60a6dffc0f7a8e721dab5ca01 /src
parent85083ec51b57ed5a44ce34c8b3610ca66dff7a68 (diff)
downloadrust-3617f0377fb797ada3a20addb9e9a24e4b8a4f43.tar.gz
rust-3617f0377fb797ada3a20addb9e9a24e4b8a4f43.zip
correct alignment
Diffstat (limited to 'src')
-rw-r--r--src/rt/arch/i386/ccall.S7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rt/arch/i386/ccall.S b/src/rt/arch/i386/ccall.S
index 3e32de879a7..297f4c79569 100644
--- a/src/rt/arch/i386/ccall.S
+++ b/src/rt/arch/i386/ccall.S
@@ -37,9 +37,10 @@ upcall_call_c_stack_shim:
 #endif
     pushl %ebp
     movl %esp,%ebp          // save esp
-    movl 8(%esp),%eax       // eax = callee
-    movl 12(%esp),%esp      // switch stack
-    pushl %esp              // push ptr to new arguments
+    movl 8(%ebp),%eax       // eax = callee
+    movl 12(%ebp),%esp      // switch stack
+    subl $12,%esp           // maintain 16-byte alignment
+    pushl 12(%ebp)          // push ptr to argument block
     calll *%eax
     movl %ebp,%esp          // would like to use "leave" but it's slower
     popl %ebp