From e4d9ef0e7cfc17aac832eaf115d1dde498941360 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 9 May 2008 18:22:01 +0000 Subject: [PATCH] setjmp() must return 1 when a 0 value has been passed to longjmp(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25398 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/arch/x86/siglongjmp.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/system/libroot/posix/arch/x86/siglongjmp.S b/src/system/libroot/posix/arch/x86/siglongjmp.S index 7774e61327..8660c140a4 100644 --- a/src/system/libroot/posix/arch/x86/siglongjmp.S +++ b/src/system/libroot/posix/arch/x86/siglongjmp.S @@ -19,6 +19,12 @@ FUNCTION(_longjmp): mov 4(%esp), %ecx mov 8(%esp), %eax + /* If value is 0, setjmp() must return 1. */ + test %eax, %eax + mov $1, %eax + jnz 1f +1: + // restore registers mov JMP_REGS_EBX(%ecx), %ebx mov JMP_REGS_ESI(%ecx), %esi