summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/dex/mir_optimization.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc
index 05414b32c7..8718191069 100644
--- a/compiler/dex/mir_optimization.cc
+++ b/compiler/dex/mir_optimization.cc
@@ -116,13 +116,14 @@ MIR* MIRGraph::AdvanceMIR(BasicBlock** p_bb, MIR* mir) {
BasicBlock* bb = *p_bb;
if (mir != NULL) {
mir = mir->next;
- if (mir == NULL) {
+ while (mir == NULL) {
bb = GetBasicBlock(bb->fall_through);
if ((bb == NULL) || Predecessors(bb) != 1) {
- mir = NULL;
+ // mir is null and we cannot proceed further.
+ break;
} else {
- *p_bb = bb;
- mir = bb->first_mir_insn;
+ *p_bb = bb;
+ mir = bb->first_mir_insn;
}
}
}