From 5a842cde8974b6927fd7199e713f89852fc467cd Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Wed, 12 Aug 2020 21:00:26 +0000 Subject: [PATCH v2] 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; --- src/setjmp/aarch64/longjmp.s | 7 +++---- 1 file 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 -- 2.28.0