We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7007bf9 commit 5339bf5Copy full SHA for 5339bf5
csrc/fusion.cpp
@@ -112,10 +112,9 @@ void Fusion::swap(Fusion& a, Fusion& b) noexcept {
112
// will only swap the ptrs NOT the contents.
113
IrContainer::swap(*(a.ir_container()), *(b.ir_container()));
114
115
- // Fix parent pointers after swapping containers
116
- // After swap, each Fusion owns a different IrContainer, so we must
117
- // update the parent backpointers in those containers to point to their new
118
- // owners
+ // After swapping container contents, update Statement::ir_container_
+ // pointers so each Statement points to the Fusion whose container now
+ // holds it.
119
if (a.ir_container_) {
120
for (auto val : a.vals()) {
121
val->ir_container_ = &a;
0 commit comments