summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r--compiler/optimizing/graph_checker.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc
index 8e6c64dbf0..190b362145 100644
--- a/compiler/optimizing/graph_checker.cc
+++ b/compiler/optimizing/graph_checker.cc
@@ -319,6 +319,12 @@ void GraphChecker::VisitBasicBlock(HBasicBlock* block) {
}
}
+ // Ensure all blocks have at least one successor, except the Exit block.
+ if (block->GetSuccessors().empty() && !block->IsExitBlock()) {
+ AddError(StringPrintf("Block %d has no successor and it is not the Exit block.",
+ block->GetBlockId()));
+ }
+
// Ensure there is no critical edge (i.e., an edge connecting a
// block with multiple successors to a block with multiple
// predecessors). Exceptional edges are synthesized and hence