Index: src/compiler/loop-variable-optimizer.cc |
diff --git a/src/compiler/loop-variable-optimizer.cc b/src/compiler/loop-variable-optimizer.cc |
index 39268f4303069a15a0bf586b7a395f7c1ee1ec6f..818cca8cfd67b46b5a96877c7b0a1ff58cfaf77d 100644 |
--- a/src/compiler/loop-variable-optimizer.cc |
+++ b/src/compiler/loop-variable-optimizer.cc |
@@ -221,7 +221,7 @@ void LoopVariableOptimizer::VisitMerge(Node* node) { |
// Merge the limits of all incoming edges. |
VariableLimits* merged = limits_[node->InputAt(0)->id()]->Copy(zone()); |
for (int i = 1; i < node->InputCount(); i++) { |
- merged->Merge(limits_[node->InputAt(0)->id()]); |
+ merged->Merge(limits_[node->InputAt(i)->id()]); |
} |
limits_[node->id()] = merged; |
} |