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

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

Issue 12079116: Fix a crash in dart2js where references to this in inlined initializers id not know what instructio… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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 | tests/language/type_variable_initializer_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/builder.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/builder.dart (revision 17974)
+++ sdk/lib/_internal/compiler/implementation/ssa/builder.dart (working copy)
@@ -1176,9 +1176,15 @@
ClosureClassMap oldClosureData = localsHandler.closureData;
Node node = constructor.parseNode(compiler);
- localsHandler.closureData =
+ ClosureClassMap newClosureData =
compiler.closureToClassMapper.computeClosureToClassMapping(
constructor, node, elements);
+ // The [:this:] element now refers to the one in the new closure
+ // data, that is the [:this:] of the super constructor. We
+ // update the element to refer to the current [:this:].
+ localsHandler.updateLocal(newClosureData.thisElement,
+ localsHandler.readThis());
+ localsHandler.closureData = newClosureData;
params.orderedForEachParameter((Element parameterElement) {
if (elements.isParameterChecked(parameterElement)) {
« no previous file with comments | « no previous file | tests/language/type_variable_initializer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698