Index: src/hydrogen-bce.cc |
diff --git a/src/hydrogen-bce.cc b/src/hydrogen-bce.cc |
index 7e9a556fbae66cbf7b31b8b6833fe8076d10c196..2514f7d259de8d63095bc416b5219762f8cca145 100644 |
--- a/src/hydrogen-bce.cc |
+++ b/src/hydrogen-bce.cc |
@@ -216,7 +216,11 @@ class BoundsCheckBbData: public ZoneObject { |
void MoveIndexIfNecessary(HValue* index_raw, |
HBoundsCheck* insert_before, |
HInstruction* end_of_scan_range) { |
- ASSERT(index_raw->IsAdd() || index_raw->IsSub()); |
+ if (!index_raw->IsAdd() && !index_raw->IsSub()) { |
+ // index_raw can be HAdd(index_base, offset), HSub(index_base, offset), |
+ // or index_base directly. In the latter case, no need to move anything. |
+ return; |
+ } |
HArithmeticBinaryOperation* index = |
HArithmeticBinaryOperation::cast(index_raw); |
HValue* left_input = index->left(); |