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

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


================
@@ -1912,6 +1929,10 @@ inline bool NoRet(InterpState &S, CodePtr OpPC) {
 
 inline bool NarrowPtr(InterpState &S, CodePtr OpPC) {
   const Pointer &Ptr = S.Stk.pop<Pointer>();
+  if (!S.getLangOpts().CPlusPlus) {
+    S.Stk.push<Pointer>(Ptr);
----------------
AaronBallman wrote:

Might be a good idea to comment why the C logic is different from the C++ logic.

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


More information about the cfe-commits mailing list