]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
libc: Fix longjmp/_longjmp(buf, 0) for AArch64 and RISC-V
authorJessica Clarke <jrtc27@FreeBSD.org>
Mon, 9 Jan 2023 18:34:43 +0000 (18:34 +0000)
committerJessica Clarke <jrtc27@FreeBSD.org>
Tue, 31 Jan 2023 01:46:18 +0000 (01:46 +0000)
commitcc58b7123be2862237746a37c1d658d0d5ca8b13
treed7f3463052014d60358c00bef45fbb9ff491ab9a
parent6879fc89425f57880fa327a1c528f657f80cf68e
libc: Fix longjmp/_longjmp(buf, 0) for AArch64 and RISC-V

These architectures fail to handle this special case, and will cause the
corresponding setjmp/_setjmp to return 0 rather than 1. Fix this and add
regression tests (also committed upstream).

PR: 268684
Reviewed by: arichardson, jhb
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D29363

(cherry picked from commit 9fb118bebced1452a46756a13be0161021b10905)
contrib/netbsd-tests/lib/libc/setjmp/t_setjmp.c
lib/libc/aarch64/gen/_setjmp.S
lib/libc/aarch64/gen/setjmp.S
lib/libc/riscv/gen/_setjmp.S
lib/libc/riscv/gen/setjmp.S