Skip to content

Commit ab1decf

Browse files
committed
Some fixes for hardened libunwind
1 parent 637245f commit ab1decf

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

libunwind/src/Registers.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,9 @@ class _LIBUNWIND_HIDDEN Registers_arm64 {
18531853
Registers_arm64();
18541854
Registers_arm64(const void *registers);
18551855

1856+
Registers_arm64(const Registers_arm64 &other);
1857+
Registers_arm64 &operator=(const Registers_arm64 &other);
1858+
18561859
bool validRegister(int num) const;
18571860
uint64_t getRegister(int num) const;
18581861
void setRegister(int num, uint64_t value);

libunwind/src/UnwindCursor.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ class UnwindCursor : public AbstractUnwindCursor{
10541054
const UnwindInfoSections &sects,
10551055
uint32_t fdeSectionOffsetHint = 0);
10561056
int stepWithDwarfFDE(bool stage2) {
1057-
typename R::reg_t rawPC = this->getReg(UNW_REG_IP);
1057+
typename R::reg_t rawPC = _registers.getIP();
10581058
typename R::link_reg_t pc;
10591059
_registers.loadAndAuthenticateLinkRegister(rawPC, &pc);
10601060
return DwarfInstructions<A, R>::stepWithDwarf(
@@ -2671,7 +2671,7 @@ void UnwindCursor<A, R>::setInfoBasedOnIPRegister(bool isReturnAddress) {
26712671
_isSigReturn = false;
26722672
#endif
26732673

2674-
typename R::reg_t rawPC = this->getReg(UNW_REG_IP);
2674+
typename R::reg_t rawPC = _registers.getIP();
26752675

26762676
#if defined(_LIBUNWIND_ARM_EHABI)
26772677
// Remove the thumb bit so the IP represents the actual instruction address.
@@ -3231,7 +3231,7 @@ void UnwindCursor<A, R>::getInfo(unw_proc_info_t *info) {
32313231
template <typename A, typename R>
32323232
bool UnwindCursor<A, R>::getFunctionName(char *buf, size_t bufLen,
32333233
unw_word_t *offset) {
3234-
typename R::reg_t rawPC = this->getReg(UNW_REG_IP);
3234+
typename R::reg_t rawPC = _registers.getIP();
32353235
typename R::link_reg_t pc;
32363236
_registers.loadAndAuthenticateLinkRegister(rawPC, &pc);
32373237

0 commit comments

Comments
 (0)