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

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

Issue 2471543004: Fix compiler crash when we declare several (global) variables, but only define some of them. (Closed)
Patch Set: cleanup Created 4 years, 1 month 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/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 9e17d7a9a503202de4c087bd2b3aba3d73dcb598..43c665183d4fed9d9287198b6606d3e1d3499a51 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -747,10 +747,15 @@ class SsaBuilder extends ast.Visitor
visit(initializer);
HInstruction value = pop();
value = potentiallyCheckOrTrustType(value, variable.type);
- ast.SendSet sendSet = node.definitions.nodes.head;
- closeAndGotoExit(new HReturn(value,
- sourceInformationBuilder.buildReturn(sendSet.assignmentOperator)));
- return closeFunction();
+ ast.Node sendSet;
+ var iterator = node.definitions.nodes.iterator;
+ while (iterator.current is! ast.SendSet) {
+ iterator.moveNext();
Johnni Winther 2016/11/02 10:41:31 To find the right node you need to check `if (iter
Emily Fortuna 2016/11/02 18:09:21 Thanks for helping me understand how this works. I
+ }
+
+ closeAndGotoExit(new HReturn(value, sourceInformationBuilder.buildReturn(
+ iterator.current.assignmentOperator)));
+ return closeFunction(); // token or source
}
/**

Powered by Google App Engine
This is Rietveld 408576698