Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: src/compiler/typer.cc

Issue 2306443003: [turbofan] Fix typing rule for CheckBounds. (Closed)
Patch Set: Improve lowering a bit. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698