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: dart/lib/compiler/implementation/ssa/closure.dart

Issue 10855125: Ensure supertypes are loaded safely. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: More cleanup of ClassElement.cloneMembersTo Created 8 years, 4 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: dart/lib/compiler/implementation/ssa/closure.dart
diff --git a/dart/lib/compiler/implementation/ssa/closure.dart b/dart/lib/compiler/implementation/ssa/closure.dart
index f6f0e3da4b48afc2d79568715998960f1d10fbca..a3a11d4d82876c06db24cf9d84ad49b488e1de5e 100644
--- a/dart/lib/compiler/implementation/ssa/closure.dart
+++ b/dart/lib/compiler/implementation/ssa/closure.dart
@@ -22,9 +22,16 @@ class ClosureClassElement extends ClassElement {
// is unique, but also emit closure classes after all other
// classes (since the emitter sorts classes by their id).
compiler.getNextFreeClassId()) {
- isResolved = true;
+ // We assign twice to [supertypeLoadState] as it contains asserts
+ // which enforce certain sequence of transitions.
+ supertypeLoadState = ClassElement.STATE_STARTED;
+ supertypeLoadState = ClassElement.STATE_DONE;
+ // Same as for [supertypeLoadState] above.
+ resolutionState = ClassElement.STATE_STARTED;
+ resolutionState = ClassElement.STATE_DONE;
compiler.closureClass.ensureResolved(compiler);
supertype = compiler.closureClass.computeType(compiler);
+ interfaces = const EmptyLink<Type>();
}
bool isClosure() => true;
}

Powered by Google App Engine
This is Rietveld 408576698