[libcxx-commits] [PATCH] D141515: [libunwind] Fixed an upcoming clang -Wsign-conversion warning

Fahad Nayyar via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 12 05:28:28 PST 2023


fahadnayyar updated this revision to Diff 488621.
fahadnayyar marked an inline comment as done.
fahadnayyar added a comment.

Correction.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141515/new/

https://reviews.llvm.org/D141515

Files:
  libunwind/src/AddressSpace.hpp


Index: libunwind/src/AddressSpace.hpp
===================================================================
--- libunwind/src/AddressSpace.hpp
+++ libunwind/src/AddressSpace.hpp
@@ -246,7 +246,7 @@
 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 @@
   if ((byte & 0x40) != 0 && bit < 64)
     result |= (-1ULL) << bit;
   addr = (pint_t) p;
-  return result;
+  return (int64_t)result;
 }
 
 inline LocalAddressSpace::pint_t


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141515.488621.patch
Type: text/x-patch
Size: 634 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230112/92561cd6/attachment.bin>


More information about the libcxx-commits mailing list