We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce96fdd commit 576ced5Copy full SHA for 576ced5
clang/lib/AST/ByteCode/InterpBlock.cpp
@@ -69,20 +69,26 @@ void Block::cleanup() {
69
void Block::replacePointer(Pointer *Old, Pointer *New) {
70
assert(Old);
71
assert(New);
72
+ assert(Old != New);
73
if (IsStatic) {
74
assert(!Pointers);
75
return;
76
}
-
77
#ifndef NDEBUG
78
assert(hasPointer(Old));
79
#endif
80
81
- removePointer(Old);
82
- addPointer(New);
+ if (Old->Prev)
+ Old->Prev->Next = New;
83
+ if (Old->Next)
84
+ Old->Next->Prev = New;
85
+ New->Prev = Old->Prev;
86
+ New->Next = Old->Next;
87
+ if (Pointers == Old)
88
+ Pointers = New;
89
90
Old->PointeeStorage.BS.Pointee = nullptr;
91
+ New->PointeeStorage.BS.Pointee = this;
92
93
assert(!hasPointer(Old));
94
assert(hasPointer(New));
0 commit comments