Index: src/arm/lithium-arm.cc |
diff --git a/src/arm/lithium-arm.cc b/src/arm/lithium-arm.cc |
index 92909d4dbaaaa501cb5da6b729d4153a2b6116ed..e3d1997668b7ef4294925bdb1409ea5f9721c6e6 100644 |
--- a/src/arm/lithium-arm.cc |
+++ b/src/arm/lithium-arm.cc |
@@ -815,7 +815,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); |
} |
} |