Index: runtime/vm/dart_api_message.cc |
diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc |
index aa0809915f208449c199f6ce556b45b85fbe01e9..2788be09d8df98f66c205ebb39e2435d96b3e1f7 100644 |
--- a/runtime/vm/dart_api_message.cc |
+++ b/runtime/vm/dart_api_message.cc |
@@ -768,10 +768,21 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id, |
READ_TYPED_DATA(Float64, double); |
case kGrowableObjectArrayCid: { |
- // A GrowableObjectArray is serialized as its 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. |
+ // A GrowableObjectArray is serialized as its type arguments and |
+ // 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. |
+ |
+ // Read and skip the type arguments field. |
+ // TODO(sjesse): Remove this when message serialization format is |
+ // updated (currently type_arguments is leaked). |
+ Dart_CObject* type_arguments = ReadObjectImpl(); |
+ if (type_arguments != &type_arguments_marker && |
+ type_arguments->type != Dart_CObject_kNull) { |
+ return AllocateDartCObjectUnsupported(); |
+ } |
+ |
+ // Read the length field. |
intptr_t len = ReadSmiValue(); |
Dart_CObject* value = GetBackRef(object_id); |