Index: src/ia32/lithium-ia32.cc |
diff --git a/src/ia32/lithium-ia32.cc b/src/ia32/lithium-ia32.cc |
index ef3f64df61a88df647f23bf16e442a8441beed61..537d92c4624248c1557b1d70cfc1e63454576640 100644 |
--- a/src/ia32/lithium-ia32.cc |
+++ b/src/ia32/lithium-ia32.cc |
@@ -870,7 +870,11 @@ void LChunkBuilder::DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block) { |
HEnvironment* last_environment = pred->last_environment(); |
for (int i = 0; i < block->phis()->length(); ++i) { |
HPhi* phi = block->phis()->at(i); |
- if (phi->merged_index() < last_environment->length()) { |
+ // TODO(mstarzinger): The length check below should actually not |
+ // be necessary, but some array stubs already rely on it. This |
+ // should be investigated and fixed. |
+ if (phi->HasMergedIndex() && |
+ phi->merged_index() < last_environment->length()) { |
last_environment->SetValueAt(phi->merged_index(), phi); |
} |
} |