aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve McIntyre <steve@einval.com>2012-06-29 18:13:34 +0100
committermaximilian attems <max@stro.at>2012-07-01 22:51:00 +0200
commitd7d16afbdae9bdea83aeb26ac572e6fc4d7d4940 (patch)
tree6015d57ca3995e0522d3a0f35ef079e2592cbd6b
parentf24132edfa296478afd40263e493fd2e095f70d2 (diff)
downloadklibc-d7d16afbdae9bdea83aeb26ac572e6fc4d7d4940.tar.gz
[klibc] arm/setjmp.S: fix longjmp
There's a real bug in the ARM assembly version of longjmp in usr/klibc/arch/arm/setjmp.S: it will always pass back its first argument as a return value, even if it's 0 (see the man page for more details). Oddly, the Thumb implementation in the same file *is* correct! Signed-off-by: Steve McIntyre <steve@einval.com> Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r--usr/klibc/arch/arm/setjmp.S4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr/klibc/arch/arm/setjmp.S b/usr/klibc/arch/arm/setjmp.S
index 6018bdadaee805..d351e0e2da8f8c 100644
--- a/usr/klibc/arch/arm/setjmp.S
+++ b/usr/klibc/arch/arm/setjmp.S
@@ -41,7 +41,9 @@ setjmp:
longjmp:
ldmia r0, {r4, r5, r6, r7, r8, r9, r10, fp, sp, lr}
mov r0, r1
- BX(lr)
+ bne 1f
+ mov r0, #1
+1: BX(lr)
.size longjmp,.-longjmp
#else /* __thumb__ */