Skip to content

Commit 31573da

Browse files
committed
PR/59351 compat_setjmp is busted
Apply the patch in the PR from Valery Ushakov (thanks) which restores the restoration of r0, lr after the call to sigblock that was lost in revision 1.3
1 parent e4d072b commit 31573da

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/libc/compat/arch/arm/gen/compat_setjmp.S

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: compat_setjmp.S,v 1.5 2020/12/05 11:18:21 skrll Exp $ */
1+
/* $NetBSD: compat_setjmp.S,v 1.6 2026/03/18 18:23:53 skrll Exp $ */
22

33
/*
44
* Copyright (c) 1997 Mark Brinicombe
@@ -46,12 +46,13 @@
4646
*/
4747

4848
ENTRY(setjmp)
49-
/* Block all signals and retrieve the old signal mask */
49+
/* Retrieve the old signal mask */
5050
push {r0, lr}
5151
movs r0, #0x00000000
5252

5353
bl PLT_SYM(_C_LABEL(sigblock))
5454
mov r1, r0
55+
pop {r0, lr}
5556

5657
/* Store signal mask */
5758
str r1, [r0, #(_JB_SIGMASK * 4)]
@@ -83,7 +84,7 @@ ENTRY(setjmp)
8384
stmia r0, {r4-lr}
8485
#endif
8586
movs r0, #0
86-
pop {r3, pc}
87+
RET
8788
END(setjmp)
8889

8990
ENTRY(longjmp)

0 commit comments

Comments
 (0)