From 5a9f6a6143883905aa61aee22b5b16aa41dba263 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 12 Mar 1998 11:39:24 +0000 Subject: [PATCH] Fix race condition. --- sysdeps/i386/__longjmp.S | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S index cb33a89de15..652e513baaf 100644 --- a/sysdeps/i386/__longjmp.S +++ b/sysdeps/i386/__longjmp.S @@ -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) -- 2.47.2