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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 1263843004: Temporary fix for pub crash by canonicalizing type only if the IsCreatedFromSnapshot bit is true (i… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix-test Created 5 years, 5 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 | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index ccf9a76975d41a93beea3bdc18ade254133ca504..cc193fa18bb2f1a8e40c0ba7b0966ab9f76db8f3 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -210,7 +210,9 @@ RawType* Type::ReadFrom(SnapshotReader* reader,
// Allocate type object.
Type& type = Type::ZoneHandle(reader->zone(), NEW_OBJECT(Type));
bool is_canonical = RawObject::IsCanonical(tags);
- bool defer_canonicalization = is_canonical && (kind != Snapshot::kFull);
+ bool defer_canonicalization = is_canonical &&
+ ((kind == Snapshot::kScript && RawObject::IsCreatedFromSnapshot(tags)) ||
+ kind == Snapshot::kMessage);
reader->AddBackRef(object_id, &type, kIsDeserialized, defer_canonicalization);
// Set all non object fields.
@@ -451,7 +453,9 @@ RawTypeArguments* TypeArguments::ReadFrom(SnapshotReader* reader,
TypeArguments& type_arguments = TypeArguments::ZoneHandle(
reader->zone(), NEW_OBJECT_WITH_LEN_SPACE(TypeArguments, len, kind));
bool is_canonical = RawObject::IsCanonical(tags);
- bool defer_canonicalization = is_canonical && (kind != Snapshot::kFull);
+ bool defer_canonicalization = is_canonical &&
+ ((kind == Snapshot::kScript && RawObject::IsCreatedFromSnapshot(tags)) ||
+ kind == Snapshot::kMessage);
reader->AddBackRef(object_id,
&type_arguments,
kIsDeserialized,
« no previous file with comments | « no previous file | runtime/vm/snapshot_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698