ART: Fix overlapping instruction IDs in inliner
Inliner creates the inner graph so that it generates instruction IDs
higher than the outer graph. This was broken because the inliner
would create instructions in the outer graph before the inner graph
is inlined.
The bug cannot be triggered because the offending instruction would
share the same ID as the first inner HLocal, which is removed before
the inner graph is inlined. The added DCHECKs reveal the hidden problem
and make it safe for HLocals to be removed in the future.
Change-Id: I486eb0f3987e20c50cbec0fb06332229e07fbae9
diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h
index e3dbe16..b684cc6 100644
--- a/compiler/optimizing/nodes.h
+++ b/compiler/optimizing/nodes.h
@@ -387,6 +387,7 @@
}
void SetCurrentInstructionId(int32_t id) {
+ DCHECK_GE(id, current_instruction_id_);
current_instruction_id_ = id;
}