diff options
| author | 2015-11-06 19:36:29 +0000 | |
|---|---|---|
| committer | 2015-11-06 19:36:29 +0000 | |
| commit | b203aad7a0db904efa8429d48b53e56583f61ec2 (patch) | |
| tree | a594385b554744b87a9b269f7df0d31675bc1c45 /compiler/optimizing/graph_checker.cc | |
| parent | 52960cd1ae1992522c8bae82fa872be49417187e (diff) | |
| parent | 9bc436160b4af99067973affb0b1008de9a2b04c (diff) | |
Merge "ART: Fix simplification of catch blocks in the presence of dead code"
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
| -rw-r--r-- | compiler/optimizing/graph_checker.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 3de96b5d84..c32ef51988 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -188,6 +188,21 @@ void GraphChecker::VisitTryBoundary(HTryBoundary* try_boundary) { VisitInstruction(try_boundary); } +void GraphChecker::VisitLoadException(HLoadException* load) { + // Ensure that LoadException is the first instruction in a catch block. + if (!load->GetBlock()->IsCatchBlock()) { + AddError(StringPrintf("%s:%d is in a non-catch block %d.", + load->DebugName(), + load->GetId(), + load->GetBlock()->GetBlockId())); + } else if (load->GetBlock()->GetFirstInstruction() != load) { + AddError(StringPrintf("%s:%d is not the first instruction in catch block %d.", + load->DebugName(), + load->GetId(), + load->GetBlock()->GetBlockId())); + } +} + void GraphChecker::VisitInstruction(HInstruction* instruction) { if (seen_ids_.IsBitSet(instruction->GetId())) { AddError(StringPrintf("Instruction id %d is duplicate in graph.", |