Skip to content

Commit 3655de7

Browse files
committed
[clang][Interp] Avoid a dangling pointer
We've just moved all the pointers from the Block to the DeadBlock, so make sure the old Block doesn't point to a linked list of Pointers that don't even point to it anymore.
1 parent 58e750b commit 3655de7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

clang/lib/AST/Interp/InterpBlock.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ DeadBlock::DeadBlock(DeadBlock *&Root, Block *Blk)
106106
B.Pointers = Blk->Pointers;
107107
for (Pointer *P = Blk->Pointers; P; P = P->Next)
108108
P->PointeeStorage.BS.Pointee = &B;
109+
Blk->Pointers = nullptr;
109110
}
110111

111112
void DeadBlock::free() {

0 commit comments

Comments
 (0)