summaryrefslogtreecommitdiff
path: root/sysdeps/i386/__longjmp.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/__longjmp.S')
-rw-r--r--sysdeps/i386/__longjmp.S7
1 files changed, 4 insertions, 3 deletions
diff --git a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S
index 7e039deb8f..a8049e9de3 100644
--- a/sysdeps/i386/__longjmp.S
+++ b/sysdeps/i386/__longjmp.S
@@ -1,5 +1,5 @@
/* longjmp for i386.
- Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 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
@@ -25,6 +25,8 @@
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
@@ -32,6 +34,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)