Index: src/compiler/typer.cc |
diff --git a/src/compiler/typer.cc b/src/compiler/typer.cc |
index 085b55482444f07d36c66c84efdbb0d2b276a486..67d11370e4b41f14198d23090bac515580b835f0 100644 |
--- a/src/compiler/typer.cc |
+++ b/src/compiler/typer.cc |
@@ -1569,7 +1569,7 @@ Type* Typer::Visitor::TypeCheckBounds(Node* node) { |
index = Type::Intersect(index, Type::Integral32(), zone()); |
if (!index->IsInhabited() || !length->IsInhabited()) return Type::None(); |
double min = std::max(index->Min(), 0.0); |
- double max = std::min(index->Max(), length->Min() - 1); |
+ double max = std::min(index->Max(), length->Max() - 1); |
if (max < min) return Type::None(); |
return Type::Range(min, max, zone()); |
} |