Преглед изворни кода

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 пре 4 година
родитељ
комит
22359b54ab
1 измењених фајлова са 3 додато и 4 уклоњено
  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