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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 3003333002: [VM] Fix deserialization of arrays with type arguments in ApiMessageReader. (Closed)
Patch Set: Created 3 years, 4 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/dart_api_message.cc
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
index 37f1a32bb6187063ec1901793dcc89d5ed2f91ff..a8ba9dc3e56c11246f0e629739d023bbed945253 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -751,6 +751,13 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
// length followed by its backing store. The backing store is an
// array with a length which might be longer than the length of
// the GrowableObjectArray.
+ Dart_CObject* value = GetBackRef(object_id);
+ ASSERT(value == NULL);
+ // Allocate an empty array for the GrowableObjectArray which
+ // will be updated to point to the content when the backing
+ // store has been deserialized.
+ value = AllocateDartCObjectArray(0);
+ AddBackRef(object_id, value, kIsDeserialized);
// Read and skip the type arguments field.
// TODO(sjesse): Remove this when message serialization format is
@@ -764,13 +771,6 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
// Read the length field.
intptr_t len = ReadSmiValue();
- Dart_CObject* value = GetBackRef(object_id);
- ASSERT(value == NULL);
- // Allocate an empty array for the GrowableObjectArray which
- // will be updated to point to the content when the backing
- // store has been deserialized.
- value = AllocateDartCObjectArray(0);
- AddBackRef(object_id, value, kIsDeserialized);
// Read the content of the GrowableObjectArray.
Dart_CObject* content = ReadObjectRef();
ASSERT(content->type == Dart_CObject_kArray);
@@ -790,7 +790,7 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
Dart_CObject* ApiMessageReader::ReadIndexedObject(intptr_t object_id) {
if (object_id == kDynamicType || object_id == kDoubleType ||
object_id == kIntType || object_id == kBoolType ||
- object_id == kStringType) {
+ object_id == kStringType || object_id == kObjectType) {
// Always return dynamic type (this is only a marker).
return &dynamic_type_marker;
}
« 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