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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 1276753002: 1. Fix the type arguments recursion problem that gets introduced when canonicalization of type argu… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address-code-review Created 5 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 | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/raw_object_snapshot.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 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);
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698