Skip to content

Commit

Permalink
[clang][Interp][NFC] Fix moveArrayTy byte offset
Browse files Browse the repository at this point in the history
We need to account for the InitMapPtr here. This is NFC right now since
no test is affected by it.
  • Loading branch information
tbaederr committed Feb 7, 2024
1 parent fb581ad commit af6656c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/lib/AST/Interp/Descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ static void dtorArrayTy(Block *, std::byte *Ptr, const Descriptor *D) {
template <typename T>
static void moveArrayTy(Block *, const std::byte *Src, std::byte *Dst,
const Descriptor *D) {
// FIXME: Need to copy the InitMap?
Src += sizeof(InitMapPtr);
Dst += sizeof(InitMapPtr);
for (unsigned I = 0, NE = D->getNumElems(); I < NE; ++I) {
const auto *SrcPtr = &reinterpret_cast<const T *>(Src)[I];
auto *DstPtr = &reinterpret_cast<T *>(Dst)[I];
Expand Down

0 comments on commit af6656c

Please sign in to comment.