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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 56033002: Compute next field offset correctly. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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/freelist.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_message.cc
===================================================================
--- runtime/vm/dart_api_message.cc (revision 29811)
+++ runtime/vm/dart_api_message.cc (working copy)
@@ -291,11 +291,12 @@
if (type != Dart_TypedData_kInvalid) {
object->type =
static_cast<Dart_CObject_Type>(Dart_CObject_Internal::kView);
- ReadObjectImpl(); // Skip type arguments.
+ Dart_CObject_Internal* cls =
+ reinterpret_cast<Dart_CObject_Internal*>(ReadObjectImpl());
+ ASSERT(cls == object->cls);
object->internal.as_view.buffer = ReadObjectImpl();
object->internal.as_view.offset_in_bytes = ReadSmiValue();
object->internal.as_view.length = ReadSmiValue();
- ReadObjectImpl(); // Skip last field.
// The buffer is fully read now as typed data objects are
// serialized in-line.
@@ -317,7 +318,9 @@
}
} else if (strcmp("dart:isolate", library_uri) == 0 &&
strncmp("_SendPortImpl@", class_name, 14) == 0) {
- ReadObjectImpl(); // Skip type arguments.
+ Dart_CObject_Internal* cls =
+ reinterpret_cast<Dart_CObject_Internal*>(ReadObjectImpl());
+ ASSERT(cls == object->cls);
// Read the port id.
Dart_CObject* port = ReadObjectImpl();
if (port->type == Dart_CObject_kInt32) {
@@ -327,7 +330,6 @@
object->type = Dart_CObject_kSendPort;
object->value.as_send_port = port->value.as_int64;
}
- ReadObjectImpl(); // Skip last field.
} else {
// TODO(sgjesse): Handle other instances. Currently this will
// skew the reading as the fields of the instance is not read.
« no previous file with comments | « no previous file | runtime/vm/freelist.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698