[libunwind] [libunwind][AIX] Cast NULL as type uintptr_t. (PR #93204)

via cfe-commits cfe-commits at lists.llvm.org
Thu May 23 08:07:23 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libunwind

Author: Xing Xue (xingxue-ibm)

<details>
<summary>Changes</summary>

Casting NULL as type `uintptr_t` to allow type checking in both 32-bit and 64-bit mode.

---
Full diff: https://github.com/llvm/llvm-project/pull/93204.diff


1 Files Affected:

- (modified) libunwind/src/UnwindCursor.hpp (+1-1) 


``````````diff
diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index 7753936a5894a..66fe8e2a32cca 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -2416,7 +2416,7 @@ int UnwindCursor<A, R>::stepWithTBTable(pint_t pc, tbtable *TBTable,
     }
 
     // Reset LR in the current context.
-    newRegisters.setLR(NULL);
+    newRegisters.setLR(static_cast<uintptr_t>(NULL));
 
     _LIBUNWIND_TRACE_UNWINDING(
         "Extract info from lastStack=%p, returnAddress=%p",

``````````

</details>


https://github.com/llvm/llvm-project/pull/93204


More information about the cfe-commits mailing list