mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user