Inliner: make sure the returned value is in the outer graph.
The returned value may be a constant or a parameter value. If so, it
will be in the inlined entry_block and (before this CL) we would not
update its block or graph. This CL fixes this and makes sure that the
returned value belongs to the outer graph.
Change-Id: Ie296f0d5a320c33f39eb187df6d328371ccf6500
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index f3b5f08..e2aca30 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -495,6 +495,9 @@
number_of_inlined_instructions_ += number_of_instructions;
HInstruction* return_replacement = callee_graph->InlineInto(graph_, invoke_instruction);
+ if (return_replacement != nullptr) {
+ DCHECK_EQ(graph_, return_replacement->GetBlock()->GetGraph());
+ }
// When merging the graph we might create a new NullConstant in the caller graph which does
// not have the chance to be typed. We assign the correct type here so that we can keep the