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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart

Issue 19347002: Fix crash https://code.google.com/p/dart/issues/detail?id=11793: only compute a range for a loop if… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | tests/language/issue11793_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart (revision 25009)
+++ sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart (working copy)
@@ -615,6 +615,11 @@
Range visitPhi(HPhi phi) {
if (!phi.isInteger()) return info.newUnboundRange();
+ // Some phases may replace instructions that change the inputs of
+ // this phi. Only the [SsaTypesPropagation] phase will update the
+ // phi type. Play it safe by assuming the [SsaTypesPropagation]
+ // phase is not necessarily run before the [ValueRangeAnalyzer].
+ if (phi.inputs.any((i) => !i.isInteger())) return info.newUnboundRange();
if (phi.block.isLoopHeader()) {
Range range = tryInferLoopPhiRange(phi);
if (range == null) return info.newUnboundRange();
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/nodes.dart ('k') | tests/language/issue11793_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698