diff options
author | 2015-06-24 13:56:48 +0000 | |
---|---|---|
committer | 2015-06-24 13:56:49 +0000 | |
commit | b809daaffdd42dc01457ae06ae83f2d7ebdb5e65 (patch) | |
tree | 16c3d455297fbf79a1d084392aada209ac2e8704 /compiler/optimizing/builder.cc | |
parent | 1c7f2f10230baf7a549af5bfd16fd3f0fb73ba21 (diff) | |
parent | fe659462e7d58bb2585b1bd029f9e08fd9dd32ae (diff) |
Merge "ART: Stop creating a fallthrough block for Goto"
Diffstat (limited to 'compiler/optimizing/builder.cc')
-rw-r--r-- | compiler/optimizing/builder.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 2bb6fbe350..e527e8bc7c 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -378,15 +378,15 @@ bool HGraphBuilder::ComputeBranchTargets(const uint16_t* code_ptr, dex_pc += instruction.SizeInCodeUnits(); code_ptr += instruction.SizeInCodeUnits(); - if (code_ptr >= code_end) { - if (instruction.CanFlowThrough()) { + if (instruction.CanFlowThrough()) { + if (code_ptr >= code_end) { // In the normal case we should never hit this but someone can artificially forge a dex // file to fall-through out the method code. In this case we bail out compilation. return false; + } else if (FindBlockStartingAt(dex_pc) == nullptr) { + block = new (arena_) HBasicBlock(graph_, dex_pc); + branch_targets_.Put(dex_pc, block); } - } else if (FindBlockStartingAt(dex_pc) == nullptr) { - block = new (arena_) HBasicBlock(graph_, dex_pc); - branch_targets_.Put(dex_pc, block); } } else if (instruction.IsSwitch()) { SwitchTable table(instruction, dex_pc, instruction.Opcode() == Instruction::SPARSE_SWITCH); |