Chromium Code Reviews| 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..0e357afa7bcc693f00c3c52e6ee0db1a0c1f2718 100644 |
| --- a/pkg/compiler/lib/src/ssa/builder.dart |
| +++ b/pkg/compiler/lib/src/ssa/builder.dart |
| @@ -747,10 +747,20 @@ 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(); |
| + // In the case of multiple declarations (and some definitions) on the same |
| + // line, the source pointer needs to point to the right initialized |
| + // variable. So find the specific initialized variable we are referring to. |
| + ast.Node sourceInfoNode = initializer; |
| + for (var definition in node.definitions) { |
| + if (definition is ast.SendSet && |
| + definition.selector.toString() == variable.name) { |
|
Siggi Cherem (dart-lang)
2016/11/02 18:17:20
toString is mainly something we use for debugging
Emily Fortuna
2016/11/02 18:24:58
Done.
|
| + sourceInfoNode = definition.assignmentOperator; |
|
Siggi Cherem (dart-lang)
2016/11/02 18:17:20
let's add a break here as well (it doesn't change
Emily Fortuna
2016/11/02 18:24:58
Done.
|
| + } |
| + } |
| + |
| + closeAndGotoExit(new HReturn(value, sourceInformationBuilder.buildReturn( |
| + sourceInfoNode))); |
| + return closeFunction(); // token or source |
|
Siggi Cherem (dart-lang)
2016/11/02 18:17:20
remove trailing comment?
Emily Fortuna
2016/11/02 18:24:58
whoops thanks.
|
| } |
| /** |