summaryrefslogtreecommitdiff
path: root/src/setjmp
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2020-08-12 21:00:26 +0000
committerRich Felker <dalias@aerifal.cx>2020-08-12 21:53:25 -0400
commit22359b54ab9a3ff0a854490f3eb0fcb838e785af (patch)
tree60bdbb3c6d3228f8e4bca17f6cfe3321a7d5b57a /src/setjmp
parent4554f155dd23a65fcdfd39f1d5af8af55ba37694 (diff)
downloadmusl-22359b54ab9a3ff0a854490f3eb0fcb838e785af.tar.gz
aarch64: fix setjmp return value
longjmp should set the return value of setjmp, but 64bit registers were used for the 0 check while the type is int. use the code that gcc generates for return val ? val : 1;
Diffstat (limited to 'src/setjmp')
-rw-r--r--src/setjmp/aarch64/longjmp.s7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/setjmp/aarch64/longjmp.s b/src/setjmp/aarch64/longjmp.s
index 7c4655fa..0af9c50e 100644
--- a/src/setjmp/aarch64/longjmp.s
+++ b/src/setjmp/aarch64/longjmp.s
@@ -18,7 +18,6 @@ longjmp:
ldp d12, d13, [x0,#144]
ldp d14, d15, [x0,#160]
- mov x0, x1
- cbnz x1, 1f
- mov x0, #1
-1: br x30
+ cmp w1, 0
+ csinc w0, w1, wzr, ne
+ br x30