]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix race condition.
authorUlrich Drepper <drepper@redhat.com>
Thu, 12 Mar 1998 11:39:24 +0000 (11:39 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 12 Mar 1998 11:39:24 +0000 (11:39 +0000)
sysdeps/i386/__longjmp.S

index cb33a89de15961c1309ae0b8233aead861e40338..652e513baaf44ec1ee3aec3aa54e7c289b32ec8b 100644 (file)
@@ -1,5 +1,5 @@
 /* longjmp for i386.
-Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
 This file is part of the GNU C Library.
 
 The GNU C Library is free software; you can redistribute it and/or
@@ -24,6 +24,8 @@ Cambridge, MA 02139, USA.  */
 ENTRY (__longjmp)
        movl 4(%esp), %ecx      /* User's jmp_buf in %ecx.  */
        movl 8(%esp), %eax      /* Second argument is return value.  */
+       /* Save the return address now.  */
+       movl (JB_PC*4)(%ecx), %edx
        /* Restore registers.  */
        movl (JB_BX*4)(%ecx), %ebx
        movl (JB_SI*4)(%ecx), %esi
@@ -31,6 +33,5 @@ ENTRY (__longjmp)
        movl (JB_BP*4)(%ecx), %ebp
        movl (JB_SP*4)(%ecx), %esp
        /* Jump to saved PC.  */
-       movl (JB_PC*4)(%ecx), %ecx
-       jmp *%ecx
+       jmp *%edx
 END (__longjmp)