diff options
author | 2015-11-10 13:01:50 +0000 | |
---|---|---|
committer | 2015-11-10 13:01:50 +0000 | |
commit | ee57104951acf3dc5f6343f1d3022e3cd73016f5 (patch) | |
tree | 6bc6affc9f105125da963434e983cb301679431e /compiler/optimizing/graph_checker.cc | |
parent | 83dcccb96ff8424fb4ab46bcda7c422d59a8c135 (diff) | |
parent | 81e479e5f768fd8ff46c2a894640a094d12800e2 (diff) |
Merge "ART: Fix critical edge checks in GraphChecker"
Diffstat (limited to 'compiler/optimizing/graph_checker.cc')
-rw-r--r-- | compiler/optimizing/graph_checker.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/optimizing/graph_checker.cc b/compiler/optimizing/graph_checker.cc index 0d7c796837..27949f7fe8 100644 --- a/compiler/optimizing/graph_checker.cc +++ b/compiler/optimizing/graph_checker.cc @@ -393,10 +393,15 @@ void SSAChecker::VisitBasicBlock(HBasicBlock* block) { // block with multiple successors to a block with multiple // predecessors). Exceptional edges are synthesized and hence // not accounted for. - if (block->NumberOfNormalSuccessors() > 1) { + if (block->GetSuccessors().size() > 1) { for (size_t j = 0, e = block->NumberOfNormalSuccessors(); j < e; ++j) { HBasicBlock* successor = block->GetSuccessors()[j]; - if (successor->GetPredecessors().size() > 1) { + if (successor->IsExitBlock() && + block->IsSingleTryBoundary() && + block->GetPredecessors().size() == 1u && + block->GetSinglePredecessor()->GetLastInstruction()->IsThrow()) { + // Allowed critical edge Throw->TryBoundary->Exit. + } else if (successor->GetPredecessors().size() > 1) { AddError(StringPrintf("Critical edge between blocks %d and %d.", block->GetBlockId(), successor->GetBlockId())); |