浏览代码

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