Skip to content

Commit 865181e

Browse files
committed
Let's stop doing this in the fragile field by field way
1 parent 3c5a776 commit 865181e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libunwind/src/Registers.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,7 @@ inline Registers_arm64::Registers_arm64(const void *registers) {
19441944
memcpy(_vectorHalfRegisters,
19451945
static_cast<const uint8_t *>(registers) + sizeof(GPRs),
19461946
sizeof(_vectorHalfRegisters));
1947+
19471948
#if defined(_LIBUNWIND_TARGET_AARCH64_AUTHENTICATED_UNWINDING)
19481949
// We have to do some pointer authentication fixups after this copy,
19491950
// and as part of that we need to load the source pc without
@@ -1962,9 +1963,7 @@ inline Registers_arm64::Registers_arm64(const Registers_arm64 &other) {
19621963

19631964
inline Registers_arm64 &
19641965
Registers_arm64::operator=(const Registers_arm64 &other) {
1965-
memmove(&_registers, &other._registers, sizeof(_registers));
1966-
memmove(_vectorHalfRegisters, &other._vectorHalfRegisters,
1967-
sizeof(_vectorHalfRegisters));
1966+
memmove(this, &other, sizeof(Registers_arm64));
19681967
// We perform this step to ensure that we correctly authenticate and re-sign
19691968
// the pc after the bitwise copy.
19701969
setIP(other.getIP());

0 commit comments

Comments
 (0)