@@ -2704,7 +2704,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_arm64 &) {
2704
2704
const pint_t pc = static_cast <pint_t >(this ->getReg (UNW_REG_IP));
2705
2705
// The PC might contain an invalid address if the unwind info is bad, so
2706
2706
// directly accessing it could cause a SIGSEGV.
2707
- if (!isReadableAddr (pc) || ! isReadableAddr (pc + 4 ) )
2707
+ if (!isReadableAddr (pc))
2708
2708
return false ;
2709
2709
auto *instructions = reinterpret_cast <const uint32_t *>(pc);
2710
2710
// Look for instructions: mov x8, #0x8b; svc #0x0
@@ -2759,7 +2759,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_riscv &) {
2759
2759
const pint_t pc = static_cast <pint_t >(getReg (UNW_REG_IP));
2760
2760
// The PC might contain an invalid address if the unwind info is bad, so
2761
2761
// directly accessing it could cause a SIGSEGV.
2762
- if (!isReadableAddr (pc) || ! isReadableAddr (pc + 4 ) )
2762
+ if (!isReadableAddr (pc))
2763
2763
return false ;
2764
2764
const auto *instructions = reinterpret_cast <const uint32_t *>(pc);
2765
2765
// Look for the two instructions used in the sigreturn trampoline
@@ -2817,7 +2817,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_s390x &) {
2817
2817
const pint_t pc = static_cast <pint_t >(this ->getReg (UNW_REG_IP));
2818
2818
// The PC might contain an invalid address if the unwind info is bad, so
2819
2819
// directly accessing it could cause a SIGSEGV.
2820
- if (!isReadableAddr (pc) || ! isReadableAddr (pc + 2 ) )
2820
+ if (!isReadableAddr (pc))
2821
2821
return false ;
2822
2822
const auto inst = *reinterpret_cast <const uint16_t *>(pc);
2823
2823
if (inst == 0x0a77 || inst == 0x0aad ) {
@@ -2972,9 +2972,7 @@ bool UnwindCursor<A, R>::isReadableAddr(const pint_t addr) const {
2972
2972
// This code is heavily based on Abseil's 'address_is_readable.cc',
2973
2973
// which is Copyright Abseil Authors (2017).
2974
2974
2975
- // Align to 8-bytes.
2976
- const auto alignedAddr = addr & ~pint_t {7 };
2977
- const auto sigsetAddr = reinterpret_cast <sigset_t *>(alignedAddr);
2975
+ const auto sigsetAddr = reinterpret_cast <sigset_t *>(addr);
2978
2976
// We have to check that addr is nullptr because sigprocmask allows that
2979
2977
// as an argument without failure.
2980
2978
if (!sigsetAddr)
0 commit comments