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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 2359543003: Make sure unresolved function type parameter bounds do not end up in snapshot. (Closed)
Patch Set: address Siva/s comments Created 4 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/parser.cc ('k') | no next file » | 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 02ba16069b16eb11cef6e9231afc839c6bf6aac2..7829e95586f585341d5ada35d4d42a430c744a11 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -258,6 +258,11 @@ void RawType::WriteTo(SnapshotWriter* writer,
writer->WriteIndexedObject(kTypeCid);
writer->WriteTags(writer->GetObjectTags(this));
+ if (ptr()->type_class_id_->IsHeapObject()) {
+ // Type class is still an unresolved class.
+ UNREACHABLE();
+ }
+
// Lookup the type class.
RawSmi* raw_type_class_id = Smi::RawCast(ptr()->type_class_id_);
RawClass* type_class =
@@ -341,6 +346,7 @@ RawTypeParameter* TypeParameter::ReadFrom(SnapshotReader* reader,
type_parameter.set_token_pos(
TokenPosition::SnapshotDecode(reader->Read<int32_t>()));
type_parameter.set_index(reader->Read<int16_t>());
+ type_parameter.set_parent_level(reader->Read<uint8_t>());
type_parameter.set_type_state(reader->Read<int8_t>());
// Set all the object fields.
@@ -376,6 +382,7 @@ void RawTypeParameter::WriteTo(SnapshotWriter* writer,
// Write out all the non object pointer fields.
writer->Write<int32_t>(ptr()->token_pos_.SnapshotEncode());
writer->Write<int16_t>(ptr()->index_);
+ writer->Write<uint8_t>(ptr()->parent_level_);
writer->Write<int8_t>(ptr()->type_state_);
// Write out all the object pointer fields.
« no previous file with comments | « runtime/vm/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698