about summary refs log tree commit diff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2004-05-10 14:42:28 +0000
committerAndreas Jaeger <aj@suse.de>2004-05-10 14:42:28 +0000
commit9f19140a4737c920478ee0c2198799a0855f2812 (patch)
treec83efa21a8be241b437f29aa9eb62525f6b4a847 /sysdeps/unix
parent66b3d19800bf84dec3aaa2112de9b0e8b98dd9c9 (diff)
downloadglibc-9f19140a4737c920478ee0c2198799a0855f2812.tar.gz
glibc-9f19140a4737c920478ee0c2198799a0855f2812.tar.xz
glibc-9f19140a4737c920478ee0c2198799a0855f2812.zip
(__makecontext): Correctly compute alignment.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/makecontext.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
index f859160a20..b1129943ab 100644
--- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
@@ -1,5 +1,5 @@
 /* Create new context.
-   Copyright (C) 2002 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
 
@@ -59,10 +59,8 @@ __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
   /* Generate room on stack for parameter if needed and uc_link.  */
   sp = (long *) ((long) ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size);
   sp -= (argc > 6 ? argc : 0) + 1;
-  /* Align stack.  */
-  sp = (long *) (((long) sp) & -16L);
-  /* Make space for trampoline address.  */
-  sp -= 8;
+  /* Align stack and make space for trampoline address.  */
+  sp = (long *) ((((long) sp) & -16L) - 8);
 
   idx_uc_link = (argc > 6 ? argc : 0) + 1;