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: 1 addition & 2 deletions clang/lib/AST/ByteCode/InterpBlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ DeadBlock::DeadBlock(DeadBlock *&Root, Block *Blk)
}

void DeadBlock::free() {
if (B.IsInitialized)
B.invokeDtor();
assert(!B.isInitialized());

if (Prev)
Prev->Next = Next;
Expand Down
6 changes: 2 additions & 4 deletions clang/lib/AST/ByteCode/InterpState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ void InterpState::deallocate(Block *B) {
if (B->IsInitialized)
B->invokeDtor();

assert(!B->isInitialized());
if (B->hasPointers()) {
size_t Size = B->getSize();
// Allocate a new block, transferring over pointers.
Expand All @@ -94,10 +95,7 @@ void InterpState::deallocate(Block *B) {
// Since the block doesn't hold any actual data anymore, we can just
// memcpy() everything over.
std::memcpy(D->rawData(), B->rawData(), B->getSize());
D->B.IsInitialized = B->IsInitialized;

// We moved the contents over to the DeadBlock.
B->IsInitialized = false;
D->B.IsInitialized = false;
}
}

Expand Down