DLA: fix moveEdgeTargetWithoutSumming

Before this commit, the method could partly fail in moving the edge
target even in legitimate scenarios, because of a bug in how it fixed up
the Successors link in the edge source.
This commit fixes the bug.
This commit is contained in:
Pietro Fezzardi
2024-01-18 14:54:22 +01:00
parent c41a6392c0
commit f598df6113
+1 -1
View File
@@ -355,7 +355,7 @@ static void moveEdgeTargetWithoutSumming(LayoutTypeSystemNode *OldTgt,
// First, move the successor from OldTgt to NewTgt
LayoutTypeSystemNode *Src = InverseEdgeIt->first;
auto SuccHandle = Src->Successors.extract({ Src, InverseEdgeIt->second });
auto SuccHandle = Src->Successors.extract({ OldTgt, InverseEdgeIt->second });
revng_assert(not SuccHandle.empty());
SuccHandle.value().first = NewTgt;
Src->Successors.insert(std::move(SuccHandle));