Skip to content

Commit af6656c

Browse files
committed
[clang][Interp][NFC] Fix moveArrayTy byte offset
We need to account for the InitMapPtr here. This is NFC right now since no test is affected by it.
1 parent fb581ad commit af6656c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/AST/Interp/Descriptor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ static void dtorArrayTy(Block *, std::byte *Ptr, const Descriptor *D) {
6363
template <typename T>
6464
static void moveArrayTy(Block *, const std::byte *Src, std::byte *Dst,
6565
const Descriptor *D) {
66+
// FIXME: Need to copy the InitMap?
67+
Src += sizeof(InitMapPtr);
68+
Dst += sizeof(InitMapPtr);
6669
for (unsigned I = 0, NE = D->getNumElems(); I < NE; ++I) {
6770
const auto *SrcPtr = &reinterpret_cast<const T *>(Src)[I];
6871
auto *DstPtr = &reinterpret_cast<T *>(Dst)[I];

0 commit comments

Comments
 (0)