Fix ids and remove invoke when inlining.
Bugs found by Razvan Lupusoru.
Change-Id: I3a5a9af280d8700d18f52abb4a2cff0e3a9aac74
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 1de5b78..73eb521 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -200,6 +200,11 @@
}
callee_graph->InlineInto(graph_, invoke_instruction);
+
+ // Now that we have inlined the callee, we need to update the next
+ // instruction id of the caller, so that new instructions added
+ // after optimizations get a unique id.
+ graph_->SetCurrentInstructionId(callee_graph->GetNextInstructionId());
VLOG(compiler) << "Successfully inlined " << PrettyMethod(method_index, outer_dex_file);
outer_stats_->RecordStat(kInlinedInvoke);
return true;