Index: src/compiler/node-properties.cc |
diff --git a/src/compiler/node-properties.cc b/src/compiler/node-properties.cc |
index 44e144883c322e8985cd3bbd3b44c6dc8a84426f..67ea06ceba52be81f33a7d1788e1bc687f5ecc55 100644 |
--- a/src/compiler/node-properties.cc |
+++ b/src/compiler/node-properties.cc |
@@ -151,16 +151,20 @@ void NodeProperties::RemoveNonValueInputs(Node* node) { |
// static |
-void NodeProperties::ReplaceWithValue(Node* node, Node* value, Node* effect) { |
+void NodeProperties::ReplaceWithValue(Node* node, Node* value, Node* effect, |
+ Node* control) { |
if (!effect && node->op()->EffectInputCount() > 0) { |
effect = NodeProperties::GetEffectInput(node); |
} |
+ if (control == nullptr && node->op()->ControlInputCount() > 0) { |
+ control = NodeProperties::GetControlInput(node); |
+ } |
// Requires distinguishing between value, effect and control edges. |
for (Edge edge : node->use_edges()) { |
if (IsControlEdge(edge)) { |
DCHECK_EQ(IrOpcode::kIfSuccess, edge.from()->opcode()); |
- Node* control = NodeProperties::GetControlInput(node); |
+ DCHECK_NOT_NULL(control); |
edge.from()->ReplaceUses(control); |
edge.UpdateTo(NULL); |
} else if (IsEffectEdge(edge)) { |