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

Unified Diff: runtime/vm/object.cc

Issue 10996002: Fix snapshot reading of canonicalized types. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 12857)
+++ runtime/vm/object.cc (working copy)
@@ -2975,6 +2975,7 @@
RawAbstractType* Type::Canonicalize() const {
ASSERT(IsFinalized());
if (IsCanonical() || IsMalformed()) {
+ ASSERT(IsMalformed() || AbstractTypeArguments::Handle(arguments()).IsOld());
return this->raw();
}
const Class& cls = Class::Handle(type_class());
@@ -3005,6 +3006,10 @@
}
index++;
}
+ // Canonicalize the type arguments.
+ AbstractTypeArguments& type_args = AbstractTypeArguments::Handle(arguments());
+ type_args = type_args.Canonicalize();
+ set_arguments(type_args);
// The type needs to be added to the list. Grow the list if it is full.
if (index == canonical_types_len) {
const intptr_t kLengthIncrement = 2; // Raw and parameterized.
@@ -3645,7 +3650,8 @@
RawAbstractTypeArguments* TypeArguments::Canonicalize() const {
- if (IsNull() || IsCanonical() || !IsInstantiated()) {
+ if (IsNull() || IsCanonical()) {
+ ASSERT(IsOld());
return this->raw();
}
siva 2012/09/25 18:55:45 Should we have an assert here: ASSERT(IsInstantia
regis 2012/09/25 19:26:25 It is not a problem to canonicalize an uninstantia
ObjectStore* object_store = Isolate::Current()->object_store();
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698