summaryrefslogtreecommitdiff
path: root/lib/libc/arch/powerpc
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2004-03-01 18:05:51 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2004-03-01 18:05:51 +0000
commit57378ed93739689af6ecbb5d6b412da911d043b3 (patch)
tree2e19cc0d8ca2b54fc8a4a4917349d23d9714c8ea /lib/libc/arch/powerpc
parentd9873e06e82f9d33629f79736c84fd76d0cacbcc (diff)
longjmp should not return 0, if longjmp(..., 0) is invoked return 1.
ok miod@ deraadt@
Diffstat (limited to 'lib/libc/arch/powerpc')
-rw-r--r--lib/libc/arch/powerpc/gen/setjmp.S10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/arch/powerpc/gen/setjmp.S b/lib/libc/arch/powerpc/gen/setjmp.S
index 9ca99b1a85a..01fde9d28e7 100644
--- a/lib/libc/arch/powerpc/gen/setjmp.S
+++ b/lib/libc/arch/powerpc/gen/setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: setjmp.S,v 1.4 2003/06/03 21:11:50 deraadt Exp $ */
+/* $OpenBSD: setjmp.S,v 1.5 2004/03/01 18:05:50 drahn Exp $ */
/*
* Copyright (c) 1996 Dale Rahn. All rights reserved.
*
@@ -147,5 +147,11 @@ ENTRY(_longjmp)
lwz 0, JMP_xer(3)
mtxer 0
/* f14-f31, fpscr */
- mr 3, 4
+
+ /* if r4 == 0, return 1, not 0 */
+ mr 3, 4
+ cmpwi 4,0
+ bne 1f
+ li 3, 1
+1:
blr