[clang] [clang][Interp] Integral pointers (PR #84159)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 6 05:55:47 PST 2024


================
@@ -2180,6 +2201,14 @@ inline bool GetFnPtr(InterpState &S, CodePtr OpPC, const Function *Func) {
   return true;
 }
 
+template <PrimType Name, class T = typename PrimConv<Name>::T>
+inline bool GetIntPtr(InterpState &S, CodePtr OpPC, const Descriptor *Desc) {
+  const T &IntVal = S.Stk.pop<T>();
+
+  S.Stk.push<Pointer>(static_cast<int64_t>(IntVal), Desc);
----------------
AaronBallman wrote:

`uintptr_t` instead?

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


More information about the cfe-commits mailing list