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

Unified Diff: pkg/compiler/lib/src/ssa/value_range_analyzer.dart

Issue 1639193003: Handle the 'integer' values INFINITY and -INIFINITY in range analysis. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/value_range_analyzer.dart
diff --git a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
index a940e71fe72a1d90b07e514338536d981242b32c..9040670b3cc766457219e870e63dbac9ffc05b2f 100644
--- a/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
+++ b/pkg/compiler/lib/src/ssa/value_range_analyzer.dart
@@ -683,6 +683,9 @@ class SsaValueRangeAnalyzer extends HBaseVisitor implements OptimizationPhase {
constantNum = constant;
}
if (constantNum.isMinusZero) constantNum = new IntConstantValue(0);
+ if (constantNum.isPositiveInfinity || constantNum.isNegativeInfinity) {
+ return info.newUnboundRange();
+ }
Value value = info.newIntValue(constantNum.primitiveValue);
return info.newNormalizedRange(value, value);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698