Skip to content

Commit 50b9db3

Browse files
alanzhao1tru
authored andcommitted
[compiler-rt][ubsan][nfc-ish] Fix a type conversion bug (llvm#100665)
If the inline asm version of `ptrauth_strip` is used instead of the builtin, the inline asm implementation currently returns an unsigned long, causing an incompatible pointer conversion issue. The spec for `ptrauth_sign` is that the result has the same type as the original value, so we add a cast to the result of the inline asm. (cherry picked from commit 25f9415)
1 parent debf818 commit 50b9db3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_ptrauth.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// the NOP space so will do nothing when it is not enabled or not available.
1919
# define ptrauth_strip(__value, __key) \
2020
({ \
21-
unsigned long ret; \
21+
__typeof(__value) ret; \
2222
asm volatile( \
2323
"mov x30, %1\n\t" \
2424
"hint #7\n\t" \

0 commit comments

Comments
 (0)