Index: runtime/vm/flow_graph.cc |
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc |
index f513b304c012f92220fa118ad8641bb91b59e133..bdfd7082ad60fa7cb11cec3a0261b55e4fb4cd95 100644 |
--- a/runtime/vm/flow_graph.cc |
+++ b/runtime/vm/flow_graph.cc |
@@ -84,6 +84,14 @@ void FlowGraph::ReplaceCurrentInstruction(ForwardInstructionIterator* iterator, |
THR_Print("Removing v%" Pd ".\n", current_defn->ssa_temp_index()); |
} |
} |
+ if (current->ArgumentCount() != 0) { |
+ // This is a call instruction. Must remove original push arguments. |
+ for (intptr_t i = 0; i < current->ArgumentCount(); ++i) { |
+ PushArgumentInstr* push = current->PushArgumentAt(i); |
+ push->ReplaceUsesWith(push->value()->definition()); |
+ push->RemoveFromGraph(); |
+ } |
+ } |
iterator->RemoveCurrentFromGraph(); |
} |