From 7cf6e84bb86ff5840896b4910ccc3865d4f00ffb Mon Sep 17 00:00:00 2001 From: Dave Watson Date: Tue, 24 May 2022 11:06:17 -0700 Subject: Revert "Address CA issue using existing libunwind macros and explicit casting" This reverts commit a9d50ef5066e8ff959dee5df5f997cc72c528f26. --- include/dwarf_i.h | 2 +- include/remote.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/dwarf_i.h b/include/dwarf_i.h index ff2c3282..58f80340 100644 --- a/include/dwarf_i.h +++ b/include/dwarf_i.h @@ -136,7 +136,7 @@ static inline int dwarf_readu8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, uint8_t *valp, void *arg) { - unw_word_t val, aligned_addr = UNW_ALIGN(*addr, sizeof (unw_word_t)); + unw_word_t val, aligned_addr = *addr & (~sizeof (unw_word_t) + 1); unw_word_t off = *addr - aligned_addr; int ret; diff --git a/include/remote.h b/include/remote.h index 0c55208a..814e532c 100644 --- a/include/remote.h +++ b/include/remote.h @@ -51,7 +51,7 @@ static inline int fetch8 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int8_t *valp, void *arg) { - unw_word_t val, aligned_addr = UNW_ALIGN(*addr, WSIZE), off = *addr - aligned_addr; + unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; int ret; *addr += 1; @@ -71,7 +71,7 @@ static inline int fetch16 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int16_t *valp, void *arg) { - unw_word_t val, aligned_addr = UNW_ALIGN(*addr, WSIZE), off = *addr - aligned_addr; + unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; int ret; if ((off & 0x1) != 0) @@ -94,7 +94,7 @@ static inline int fetch32 (unw_addr_space_t as, unw_accessors_t *a, unw_word_t *addr, int32_t *valp, void *arg) { - unw_word_t val, aligned_addr = UNW_ALIGN(*addr, WSIZE), off = *addr - aligned_addr; + unw_word_t val, aligned_addr = *addr & (~WSIZE + 1), off = *addr - aligned_addr; int ret; if ((off & 0x3) != 0) -- cgit v1.2.1