From 2f36ef5afe5aae9b150597d6281826a1c3ed2f3a Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Thu, 5 Jul 2012 13:52:36 +0100 Subject: [PATCH] Fixed the x86_64 setjmp implementation. * typedef for jmp_buf was using int where it should be long. * setjmp was clearing the buffer pointer rather than the signal mask before calling sigsetjmp. * KDL now works without crashing on x86_64. --- headers/posix/arch/x86_64/arch_setjmp.h | 2 +- src/system/libroot/posix/arch/x86_64/sigsetjmp.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/headers/posix/arch/x86_64/arch_setjmp.h b/headers/posix/arch/x86_64/arch_setjmp.h index 2d8f39ec4d..e1043da0c3 100644 --- a/headers/posix/arch/x86_64/arch_setjmp.h +++ b/headers/posix/arch/x86_64/arch_setjmp.h @@ -6,6 +6,6 @@ #define _ARCH_SETJMP_H_ -typedef int __jmp_buf[8]; +typedef unsigned long __jmp_buf[8]; #endif /* _ARCH_SETJMP_H_ */ diff --git a/src/system/libroot/posix/arch/x86_64/sigsetjmp.S b/src/system/libroot/posix/arch/x86_64/sigsetjmp.S index 25bef80a68..0e7b5afc77 100644 --- a/src/system/libroot/posix/arch/x86_64/sigsetjmp.S +++ b/src/system/libroot/posix/arch/x86_64/sigsetjmp.S @@ -31,7 +31,7 @@ FUNCTION_END(setjmp) /* int setjmp(jmp_buf buffer) */ FUNCTION(setjmp): // Jump to sigsetjmp with a zero saveMask. - xorl %edi, %edi + xorl %esi, %esi jmp sigsetjmp FUNCTION_END(setjmp)