Skip to content

Commit 058521c

Browse files
fixup! fixup! [libunwind] Replace process_vm_readv with pipe
1 parent 2346a2a commit 058521c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

libunwind/src/UnwindCursor.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,7 +2704,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_arm64 &) {
27042704
const pint_t pc = static_cast<pint_t>(this->getReg(UNW_REG_IP));
27052705
// The PC might contain an invalid address if the unwind info is bad, so
27062706
// directly accessing it could cause a SIGSEGV.
2707-
if (!isReadableAddr(pc) || !isReadableAddr(pc + 4))
2707+
if (!isReadableAddr(pc))
27082708
return false;
27092709
auto *instructions = reinterpret_cast<const uint32_t *>(pc);
27102710
// Look for instructions: mov x8, #0x8b; svc #0x0
@@ -2759,7 +2759,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_riscv &) {
27592759
const pint_t pc = static_cast<pint_t>(getReg(UNW_REG_IP));
27602760
// The PC might contain an invalid address if the unwind info is bad, so
27612761
// directly accessing it could cause a SIGSEGV.
2762-
if (!isReadableAddr(pc) || !isReadableAddr(pc + 4))
2762+
if (!isReadableAddr(pc))
27632763
return false;
27642764
const auto *instructions = reinterpret_cast<const uint32_t *>(pc);
27652765
// Look for the two instructions used in the sigreturn trampoline
@@ -2817,7 +2817,7 @@ bool UnwindCursor<A, R>::setInfoForSigReturn(Registers_s390x &) {
28172817
const pint_t pc = static_cast<pint_t>(this->getReg(UNW_REG_IP));
28182818
// The PC might contain an invalid address if the unwind info is bad, so
28192819
// directly accessing it could cause a SIGSEGV.
2820-
if (!isReadableAddr(pc) || !isReadableAddr(pc + 2))
2820+
if (!isReadableAddr(pc))
28212821
return false;
28222822
const auto inst = *reinterpret_cast<const uint16_t *>(pc);
28232823
if (inst == 0x0a77 || inst == 0x0aad) {
@@ -2972,9 +2972,7 @@ bool UnwindCursor<A, R>::isReadableAddr(const pint_t addr) const {
29722972
// This code is heavily based on Abseil's 'address_is_readable.cc',
29732973
// which is Copyright Abseil Authors (2017).
29742974

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);
29782976
// We have to check that addr is nullptr because sigprocmask allows that
29792977
// as an argument without failure.
29802978
if (!sigsetAddr)

0 commit comments

Comments
 (0)