Skip to content

Commit 3617f03

Browse files
committed
correct alignment
1 parent 85083ec commit 3617f03

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/rt/arch/i386/ccall.S

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ upcall_call_c_stack_shim:
3737
#endif
3838
pushl %ebp
3939
movl %esp,%ebp // save esp
40-
movl 8(%esp),%eax // eax = callee
41-
movl 12(%esp),%esp // switch stack
42-
pushl %esp // push ptr to new arguments
40+
movl 8(%ebp),%eax // eax = callee
41+
movl 12(%ebp),%esp // switch stack
42+
subl $12,%esp // maintain 16-byte alignment
43+
pushl 12(%ebp) // push ptr to argument block
4344
calll *%eax
4445
movl %ebp,%esp // would like to use "leave" but it's slower
4546
popl %ebp

0 commit comments

Comments
 (0)