Skip to content

Conversation

@tbaederr
Copy link
Contributor

Since these are all primitive arrays, use the new elem() and initializeElement() functions.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:bytecode Issues for the clang bytecode constexpr interpreter labels Oct 12, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 12, 2025

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

Changes

Since these are all primitive arrays, use the new elem() and initializeElement() functions.


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

1 Files Affected:

  • (modified) clang/lib/AST/ByteCode/Interp.h (+2-3)
diff --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h
index bb0c4580b14a9..a9c71c771c9ae 100644
--- a/clang/lib/AST/ByteCode/Interp.h
+++ b/clang/lib/AST/ByteCode/Interp.h
@@ -3183,9 +3183,8 @@ inline bool CopyArray(InterpState &S, CodePtr OpPC, uint32_t SrcIndex,
     if (!CheckLoad(S, OpPC, SP))
       return false;
 
-    const Pointer &DP = DestPtr.atIndex(DestIndex + I);
-    DP.deref<T>() = SP.deref<T>();
-    DP.initialize();
+    DestPtr.elem<T>(DestIndex + I) = SrcPtr.elem<T>(SrcIndex + I);
+    DestPtr.initializeElement(DestIndex + I);
   }
   return true;
 }

@tbaederr tbaederr merged commit a5e30f8 into llvm:main Oct 12, 2025
14 checks passed
DharuniRAcharya pushed a commit to DharuniRAcharya/llvm-project that referenced this pull request Oct 13, 2025
…163042)

Since these are all primitive arrays, use the new `elem()` and
`initializeElement()` functions.
akadutta pushed a commit to akadutta/llvm-project that referenced this pull request Oct 14, 2025
…163042)

Since these are all primitive arrays, use the new `elem()` and
`initializeElement()` functions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:bytecode Issues for the clang bytecode constexpr interpreter clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants