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() = SP.deref(); - DP.initialize(); + DestPtr.elem(DestIndex + I) = SrcPtr.elem(SrcIndex + I); + DestPtr.initializeElement(DestIndex + I); } return true; }