[libunwind] 226798f - [libunwind] Fixed an upcoming clang -Wsign-conversion warning
Fahad Nayyar via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 13 08:02:38 PST 2023
Author: Fahad Nayyar
Date: 2023-01-13T16:01:37Z
New Revision: 226798f3aa2f8467a29d909f0b18dbc4dfb398f7
URL: https://github.com/llvm/llvm-project/commit/226798f3aa2f8467a29d909f0b18dbc4dfb398f7
DIFF: https://github.com/llvm/llvm-project/commit/226798f3aa2f8467a29d909f0b18dbc4dfb398f7.diff
LOG: [libunwind] Fixed an upcoming clang -Wsign-conversion warning
Fixing an upcoming clang warning (from https://reviews.llvm.org/D139114) in libunwind.
Differential Revision: https://reviews.llvm.org/D141515
Added:
Modified:
libunwind/src/AddressSpace.hpp
Removed:
################################################################################
diff --git a/libunwind/src/AddressSpace.hpp b/libunwind/src/AddressSpace.hpp
index b0135b0c0519c..26d289068b38c 100644
--- a/libunwind/src/AddressSpace.hpp
+++ b/libunwind/src/AddressSpace.hpp
@@ -246,7 +246,7 @@ inline uint64_t LocalAddressSpace::getULEB128(pint_t &addr, pint_t end) {
inline int64_t LocalAddressSpace::getSLEB128(pint_t &addr, pint_t end) {
const uint8_t *p = (uint8_t *)addr;
const uint8_t *pend = (uint8_t *)end;
- int64_t result = 0;
+ uint64_t result = 0;
int bit = 0;
uint8_t byte;
do {
@@ -260,7 +260,7 @@ inline int64_t LocalAddressSpace::getSLEB128(pint_t &addr, pint_t end) {
if ((byte & 0x40) != 0 && bit < 64)
result |= (-1ULL) << bit;
addr = (pint_t) p;
- return result;
+ return (int64_t)result;
}
inline LocalAddressSpace::pint_t
More information about the cfe-commits
mailing list