Index: src/interpreter/bytecode-generator.cc |
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
index bdc5370f5a30ac5779f65f6999c3470256a712cf..37ef95ce5bfe4368ff4d90b1904a19adb0bc9adf 100644 |
--- a/src/interpreter/bytecode-generator.cc |
+++ b/src/interpreter/bytecode-generator.cc |
@@ -633,14 +633,13 @@ void BytecodeGenerator::BuildIndexedJump(Register index, size_t start_index, |
size_t size, |
ZoneVector<BytecodeLabel>& targets) { |
// TODO(neis): Optimize this by using a proper jump table. |
+ DCHECK_LE(start_index + size, targets.size()); |
for (size_t i = start_index; i < start_index + size; i++) { |
- DCHECK(0 <= i && i < targets.size()); |
builder() |
->LoadLiteral(Smi::FromInt(static_cast<int>(i))) |
.CompareOperation(Token::Value::EQ_STRICT, index) |
.JumpIfTrue(&(targets[i])); |
} |
- |
BuildAbort(BailoutReason::kInvalidJumpTableIndex); |
} |
@@ -654,8 +653,8 @@ void BytecodeGenerator::VisitIterationHeader(IterationStatement* stmt, |
// for these resume points, to be used inside the loop. |
ZoneVector<BytecodeLabel> resume_points_in_loop(zone()); |
size_t first_yield = stmt->first_yield_id(); |
+ DCHECK_LE(first_yield + stmt->yield_count(), generator_resume_points_.size()); |
for (size_t id = first_yield; id < first_yield + stmt->yield_count(); id++) { |
- DCHECK(0 <= id && id < generator_resume_points_.size()); |
auto& label = generator_resume_points_[id]; |
resume_points_in_loop.push_back(label); |
generator_resume_points_[id] = BytecodeLabel(); |