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:
Andrea Gussoni
2025-06-17 11:02:51 +02:00
parent 2ed4bffc53
commit f45b706972
+7 -1
View File
@@ -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);
}
}