Ver Fonte

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;
Szabolcs Nagy há 4 anos atrás
pai
commit
22359b54ab
1 ficheiros alterados com 3 adições e 4 exclusões
  1. 3 4
      src/setjmp/aarch64/longjmp.s

+ 3 - 4
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