summaryrefslogtreecommitdiff
path: root/compiler/optimizing/nodes.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2016-04-20 18:42:26 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2016-04-20 18:42:26 +0000
commit388321af409c3d665fd55f3271537ecfe728c91d (patch)
tree0ac0258373c65494803d70e0762fbd83ee7c537e /compiler/optimizing/nodes.cc
parent44e5cd860363e31eb7687f82f68a61ae119a2989 (diff)
parentc6b5627c25ff5653e97ccff8c5ccf6ac967b6f83 (diff)
Merge "Fix HInstruction::ReplaceInput(), allow no-op."
Diffstat (limited to 'compiler/optimizing/nodes.cc')
-rw-r--r--compiler/optimizing/nodes.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/optimizing/nodes.cc b/compiler/optimizing/nodes.cc
index 7c6e9318fb..fe75451ad2 100644
--- a/compiler/optimizing/nodes.cc
+++ b/compiler/optimizing/nodes.cc
@@ -1022,8 +1022,11 @@ void HInstruction::ReplaceWith(HInstruction* other) {
void HInstruction::ReplaceInput(HInstruction* replacement, size_t index) {
HUserRecord<HInstruction*> input_use = InputRecordAt(index);
+ if (input_use.GetInstruction() == replacement) {
+ // Nothing to do.
+ return;
+ }
HUseList<HInstruction*>::iterator before_use_node = input_use.GetBeforeUseNode();
- DCHECK(input_use.GetInstruction() != replacement);
// Note: fixup_end remains valid across splice_after().
auto fixup_end =
replacement->uses_.empty() ? replacement->uses_.begin() : ++replacement->uses_.begin();