[libunwind] 7c651a1 - [libunwind][AIX] static_cast the value from getLR() to avoid the warning from -Wconversion (#69767)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 24 08:55:27 PDT 2023


Author: xingxue-ibm
Date: 2023-10-24T11:55:22-04:00
New Revision: 7c651a1fc006929674c0795086144f099c61ff8c

URL: https://github.com/llvm/llvm-project/commit/7c651a1fc006929674c0795086144f099c61ff8c
DIFF: https://github.com/llvm/llvm-project/commit/7c651a1fc006929674c0795086144f099c61ff8c.diff

LOG: [libunwind][AIX] static_cast the value from getLR() to avoid the warning from -Wconversion (#69767)

This PR adds `static_cast` to the value returned from `getLR()` in the
AIX unwinder to avoid warning in case `-Wconversion` is specified to
build in 32-bit mode.

Added: 
    

Modified: 
    libunwind/src/UnwindCursor.hpp

Removed: 
    


################################################################################
diff  --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index f89c5b2c2f73e33..647a5a9c9d92d91 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -2404,7 +2404,7 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,
     if (!TBTable->tb.saves_lr && registers.getLR()) {
       // This case should only occur if we were called from a signal handler
       // and the signal occurred in a function that doesn't save the LR.
-      returnAddress = registers.getLR();
+      returnAddress = static_cast<pint_t>(registers.getLR());
       _LIBUNWIND_TRACE_UNWINDING("Use saved LR=%p",
                                  reinterpret_cast<void *>(returnAddress));
     } else {


        


More information about the cfe-commits mailing list