Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/lib/AST/ByteCode/Interp.h
Original file line number Diff line number Diff line change
Expand Up @@ -3156,6 +3156,9 @@ inline bool CopyArray(InterpState &S, CodePtr OpPC, uint32_t SrcIndex,
const auto &SrcPtr = S.Stk.pop<Pointer>();
const auto &DestPtr = S.Stk.peek<Pointer>();

if (SrcPtr.isDummy() || DestPtr.isDummy())
return false;

for (uint32_t I = 0; I != Size; ++I) {
const Pointer &SP = SrcPtr.atIndex(SrcIndex + I);

Expand Down
12 changes: 12 additions & 0 deletions clang/test/AST/ByteCode/vectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,15 @@ namespace Assign {
}
static_assert(invalid()); // both-error {{not an integral constant expression}}
}

namespace CopyArrayDummy {
struct S {
long a, b, c, d;
};
typedef long T __attribute__((vector_size(4 * sizeof(long))));

void foo(void) {
struct S s;
*(T *)&s = (T){0, 1, 2, 3};
}
}
Loading