mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
RestructureCFG: fail when retreating not to head
Introduce decompilation failure when not all the retreatings of a `Region` point to the elected head node.
This commit is contained in:
@@ -773,7 +773,13 @@ bool restructureCFG(Function &F, ASTTree &AST) {
|
||||
// retreating edges in the `ContinueBackedges` set, checking that they
|
||||
// point to the `Entry` node
|
||||
for (EdgeDescriptor R : Retreatings) {
|
||||
revng_assert(R.second == Entry);
|
||||
|
||||
// The following should be an assert, but since the backend is in
|
||||
// maintenance mode, we have an early return to propagate an early
|
||||
// failure
|
||||
if (not(R.second == Entry))
|
||||
return false;
|
||||
|
||||
ContinueBackedges.push_back(R);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user