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

Unified Diff: pkg/compiler/lib/src/kernel/kernel_visitor.dart

Issue 2682553002: Fix lingering switch statement test failures. (Closed)
Patch Set: . Created 3 years, 10 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
Index: pkg/compiler/lib/src/kernel/kernel_visitor.dart
diff --git a/pkg/compiler/lib/src/kernel/kernel_visitor.dart b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
index 13544295ed919f797916a645838a3cf9185598cd..5f0d3841491c12c4980eb037ca28a36f281b4c49 100644
--- a/pkg/compiler/lib/src/kernel/kernel_visitor.dart
+++ b/pkg/compiler/lib/src/kernel/kernel_visitor.dart
@@ -591,7 +591,7 @@ class KernelVisitor extends Object
// One VariableDefinitions statement node (dart2js AST) may generate
// multiple statements in Kernel IR so we sometimes fall through here.
}
- return new ir.Block(statements);
+ return associateNode(new ir.Block(statements), node);
}
@override
@@ -826,6 +826,7 @@ class KernelVisitor extends Object
// its visit method (so it can build break targets correctly).
? statement.accept(this)
: buildStatementInBlock(statement);
+ associateNode(result, statement);
// A [LabeledStatement] isn't the actual jump target, instead, [statement]
// is the target. This allows uniform handling of break and continue in
@@ -999,7 +1000,8 @@ class KernelVisitor extends Object
}
// We ignore the node's statements here, they're generated below in
// [visitSwitchStatement] once we've set up all the jump targets.
- return new ir.SwitchCase(expressions, null, isDefault: node.isDefaultCase);
+ return associateNode(new ir.SwitchCase(expressions, null,
+ isDefault: node.isDefaultCase), node);
}
/// Returns true if [node] would let execution reach the next node (aka
« no previous file with comments | « no previous file | pkg/compiler/lib/src/resolution/members.dart » ('j') | pkg/compiler/lib/src/resolution/members.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698