Index: src/interpreter/bytecode-array-builder.cc |
diff --git a/src/interpreter/bytecode-array-builder.cc b/src/interpreter/bytecode-array-builder.cc |
index 20e8b71b001c1f360c70056969518b37b8f0cbfe..262f9b9dc280aedcaec2fafc82127e8f07103b60 100644 |
--- a/src/interpreter/bytecode-array-builder.cc |
+++ b/src/interpreter/bytecode-array-builder.cc |
@@ -681,7 +681,7 @@ bool BytecodeArrayBuilder::OperandsAreValid( |
CHECK_NE(i, 0); |
CHECK(operand_types[i - 1] == OperandType::kMaybeReg || |
operand_types[i - 1] == OperandType::kReg); |
- if (operands[i] > 0) { |
+ if (i > 0 && operands[i] > 0) { |
Register start = Register::FromOperand(operands[i - 1]); |
Register end(start.index() + static_cast<int>(operands[i]) - 1); |
if (!RegisterIsValid(start) || !RegisterIsValid(end) || start > end) { |