diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-01-04 13:51:21 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-01-04 13:51:21 +0000 |
commit | 6bbd1149228420180ef19b4521a8920025232c08 (patch) | |
tree | 7954b70f31286cd5752f15c8475ddbdd83b34071 /lib/libc/arch/alpha | |
parent | 42ef0e6a6966cc7c34b69792602e5ec91b777625 (diff) |
longjmp(..., 0) is not really legal, but all other archs I've looked
at make sure that setjmp doesn't return 0 if longjmp is passed a 0.
Avoid surprises.
Diffstat (limited to 'lib/libc/arch/alpha')
-rw-r--r-- | lib/libc/arch/alpha/gen/_setjmp.S | 7 | ||||
-rw-r--r-- | lib/libc/arch/alpha/gen/setjmp.S | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/libc/arch/alpha/gen/_setjmp.S b/lib/libc/arch/alpha/gen/_setjmp.S index 711bb7abbce..5ad0bf9cce6 100644 --- a/lib/libc/arch/alpha/gen/_setjmp.S +++ b/lib/libc/arch/alpha/gen/_setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: _setjmp.S,v 1.3 1996/11/13 21:20:09 niklas Exp $ */ +/* $OpenBSD: _setjmp.S,v 1.4 2002/01/04 13:51:20 art Exp $ */ /* $NetBSD: _setjmp.S,v 1.2 1996/10/17 03:08:03 cgd Exp $ */ /* @@ -32,7 +32,7 @@ #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: _setjmp.S,v 1.3 1996/11/13 21:20:09 niklas Exp $" + .asciz "$OpenBSD: _setjmp.S,v 1.4 2002/01/04 13:51:20 art Exp $" #endif /* @@ -119,6 +119,9 @@ LEAF(_longjmp, 2) ldt ft0, (69 * 8)(a0) /* get sc_fpcr */ mt_fpcr ft0 /* and restore it. */ + bne a1, 1f + addq a1, 1, a1 +1: mov a1, v0 /* return second arg */ RET diff --git a/lib/libc/arch/alpha/gen/setjmp.S b/lib/libc/arch/alpha/gen/setjmp.S index 0caaec361c7..66d0d42b4e7 100644 --- a/lib/libc/arch/alpha/gen/setjmp.S +++ b/lib/libc/arch/alpha/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.3 1996/11/13 21:20:21 niklas Exp $ */ +/* $OpenBSD: setjmp.S,v 1.4 2002/01/04 13:51:20 art Exp $ */ /* $NetBSD: setjmp.S,v 1.2 1996/10/17 03:08:06 cgd Exp $ */ /* @@ -32,7 +32,7 @@ #if defined(LIBC_SCCS) .text - .asciz "$OpenBSD: setjmp.S,v 1.3 1996/11/13 21:20:21 niklas Exp $" + .asciz "$OpenBSD: setjmp.S,v 1.4 2002/01/04 13:51:20 art Exp $" #endif /* @@ -120,6 +120,9 @@ END(setjmp) LEAF(longjmp, 2) LDGP(pv) + bne a1, 1f + addq a1, 1, a1 +1: stq a1, (( 0 + 4) * 8)(a0) /* save return value */ CALL(sigreturn) /* use sigreturn to return */ @@ -128,3 +131,4 @@ botch: CALL(abort) RET /* "can't" get here... */ END(longjmp) + |