Skip to content

Commit e22d884

Browse files
test suspected compiler issue around returning with register variable
1 parent 1423c03 commit e22d884

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libunwind/src/Registers.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,13 +1836,14 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
18361836
// Authenticate the given pointer and return with the raw value
18371837
// if the authentication is succeeded.
18381838
inline uint64_t auth(uint64_t ptr, uint64_t salt) const {
1839+
uint64_t ret;
18391840
register uint64_t x17 __asm("x17") = ptr;
18401841
register uint64_t x16 __asm("x16") = salt;
18411842
asm volatile ("hint 0xc" // autia1716
18421843
: "+r"(x17)
18431844
: "r"(x16)
18441845
:);
1845-
1846+
ret = x17;
18461847
uint64_t checkValue = ptr;
18471848
// Support for machines without FPAC.
18481849
// Strip the upper bits with `XPACLRI` and compare with the
@@ -1855,7 +1856,7 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
18551856
: "x30");
18561857
if (x17 != checkValue)
18571858
_LIBUNWIND_ABORT("IP PAC authentication failure");
1858-
return x17;
1859+
return ret;
18591860
}
18601861

18611862
// Sign the PC with the A-KEY and the current salt.

0 commit comments

Comments
 (0)