From 547d71a18f20da3856d73302f1e6c5d9f0ebfa73 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 10 Aug 2004 14:24:00 +0000 Subject: [PATCH] ffi64.c (ffi_prep_args ): 8-align all stack arguments. 2004-08-10 Andrew Haley * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments. From-SVN: r85753 --- libffi/ChangeLog | 4 ++++ libffi/src/x86/ffi64.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/libffi/ChangeLog b/libffi/ChangeLog index d01a4dd06a2..61b0b4f43f4 100644 --- a/libffi/ChangeLog +++ b/libffi/ChangeLog @@ -1,3 +1,7 @@ +2004-08-10 Andrew Haley + + * src/x86/ffi64.c (ffi_prep_args ): 8-align all stack arguments. + 2004-08-01 Robert Millan * configure.ac: Detect knetbsd-gnu and kfreebsd-gnu. diff --git a/libffi/src/x86/ffi64.c b/libffi/src/x86/ffi64.c index 343ee925fde..653d45c243a 100644 --- a/libffi/src/x86/ffi64.c +++ b/libffi/src/x86/ffi64.c @@ -341,6 +341,8 @@ ffi_prep_args (stackLayout *stack, extended_cif *ecif) { /* Pass this argument in memory. */ argp = (void *)ALIGN(argp, (*p_arg)->alignment); + /* Stack arguments are *always* at least 8 byte aligned. */ + argp = (void *)ALIGN(argp, 8); memcpy (argp, *p_argv, (*p_arg)->size); argp += (*p_arg)->size; } -- 2.30.2