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

Unified Diff: pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart

Issue 1222673002: dart2js cps: Fix bug in assignment propagation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Rebase Created 5 years, 6 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/tree_ir/optimization/statement_rewriter.dart
diff --git a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
index 8025ec3b2ff1feaf2aa896ccd5a63cab71b64b0d..be59dc90692297fe4217949f62c5415defa83806 100644
--- a/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
+++ b/pkg/compiler/lib/src/tree_ir/optimization/statement_rewriter.dart
@@ -377,7 +377,11 @@ class StatementRewriter extends Transformer implements Pass {
Statement next = visitStatement(stmt.next);
popDominatingAssignment(leftHand);
if (assign.variable.readCount > 0) {
- // The assignment could not be propagated.
+ // The assignment could not be propagated into the successor, either
+ // because it has an unsafe variable use (see [hasUnsafeVariableUse])
+ // or because the use is outside the current try block, and we do
+ // not currently support constant propagation out of a try block.
+ constantEnvironment.remove(assign.variable);
assign.value = visitExpression(assign.value);
stmt.next = next;
return stmt;
« 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