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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 1589643002: Source positions for constructors and lots of async machinery (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 | « runtime/vm/parser.cc ('k') | runtime/vm/regexp_assembler_ir.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 132560dae935422bcdce175e524511b330647065..223a93139bf373e984ea1d6ddd55c733f5b65c83 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -665,12 +665,15 @@ RawFunction* Function::ReadFrom(SnapshotReader* reader,
reader->zone(), NEW_OBJECT(Function));
reader->AddBackRef(object_id, &func, kIsDeserialized);
- // Set all the non object fields.
- func.set_token_pos(reader->Read<int32_t>());
- func.set_end_token_pos(reader->Read<int32_t>());
+ // Set all the non object fields. Read the token positions now but
+ // don't set them until after setting the kind.
+ const int32_t token_pos = reader->Read<int32_t>();
+ const int32_t end_token_pos = reader->Read<uint32_t>();
func.set_num_fixed_parameters(reader->Read<int16_t>());
func.set_num_optional_parameters(reader->Read<int16_t>());
func.set_kind_tag(reader->Read<uint32_t>());
+ func.set_token_pos(token_pos);
+ func.set_end_token_pos(end_token_pos);
if (reader->snapshot_code()) {
func.set_usage_counter(0);
func.set_deoptimization_counter(0);
« no previous file with comments | « runtime/vm/parser.cc ('k') | runtime/vm/regexp_assembler_ir.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698