diff options
author | Aaron Robinson <arobins@microsoft.com> | 2022-03-14 11:39:20 -0700 |
---|---|---|
committer | Dave Watson <dade.watson@gmail.com> | 2022-05-22 10:58:11 -0700 |
commit | a9d50ef5066e8ff959dee5df5f997cc72c528f26 (patch) | |
tree | 29705b0f8c44e3c041137bae4c8a65901f379374 /src | |
parent | 0554c9bfb7def1e021127208f5351bded62aa659 (diff) | |
download | libunwind-a9d50ef5066e8ff959dee5df5f997cc72c528f26.tar.gz |
Address CA issue using existing libunwind macros and explicit casting
when it is logically appropriate.
Diffstat (limited to 'src')
-rw-r--r-- | src/dwarf/Gexpr.c | 4 | ||||
-rw-r--r-- | src/dwarf/Gparser.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/dwarf/Gexpr.c b/src/dwarf/Gexpr.c index 977c5593..d1cb2375 100644 --- a/src/dwarf/Gexpr.c +++ b/src/dwarf/Gexpr.c @@ -530,7 +530,7 @@ if (stackerror) \ Debug (15, "OP_abs\n"); tmp1 = pop (); if (tmp1 & ((unw_word_t) 1 << (8 * dwarf_addr_size (as) - 1))) - tmp1 = (~tmp1 + 1); + tmp1 = (unw_word_t)(-(unw_sword_t)tmp1); push (tmp1); break; @@ -578,7 +578,7 @@ if (stackerror) \ case DW_OP_neg: Debug (15, "OP_neg\n"); - push (~pop () + 1); + push (-(unw_sword_t)pop ()); break; case DW_OP_not: diff --git a/src/dwarf/Gparser.c b/src/dwarf/Gparser.c index 3f3722a3..7abf199c 100644 --- a/src/dwarf/Gparser.c +++ b/src/dwarf/Gparser.c @@ -397,9 +397,9 @@ run_cfi_program (struct dwarf_cursor *c, dwarf_state_record_t *sr, if (((ret = read_regnum (as, a, addr, ®num, arg)) < 0) || ((ret = dwarf_read_uleb128 (as, a, addr, &val, arg)) < 0)) break; - set_reg (sr, regnum, DWARF_WHERE_CFAREL, ~(val * dci->data_align) + 1); + set_reg (sr, regnum, DWARF_WHERE_CFAREL, (unw_word_t)(-(unw_sword_t)val)); Debug (15, "CFA_GNU_negative_offset_extended cfa+0x%lx\n", - (long) (~(val * dci->data_align) + 1)); + (long)(unw_word_t)(-(unw_sword_t)val)); break; case DW_CFA_GNU_window_save: |