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

Unified Diff: runtime/vm/dart_api_message.cc

Issue 12893013: dart:io | Fix error in deserializing of native port messages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | tests/standalone/standalone.status » ('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 180a43c1bfe53d509cfe1b7e1cece06cd8e31ed1..ab1e0605a1457f4e2bd07186a15b33d8d265761a 100644
--- a/runtime/vm/dart_api_message.cc
+++ b/runtime/vm/dart_api_message.cc
@@ -267,7 +267,10 @@ Dart_CObject* ApiMessageReader::ReadObjectRef() {
// Reading of regular dart instances is not supported.
if (SerializedHeaderData::decode(class_header) == kInstanceObjectId) {
- return AllocateDartCObjectUnsupported();
+ intptr_t object_id = SerializedHeaderData::decode(value);
+ Dart_CObject* object = AllocateDartCObjectUnsupported();
+ AddBackRef(object_id, object, kIsNotDeserialized);
+ return object;
}
ASSERT((class_header & kSmiTagMask) != 0);
intptr_t object_id = SerializedHeaderData::decode(value);
@@ -310,7 +313,9 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
intptr_t object_id) {
switch (class_id) {
case kClassCid: {
- return AllocateDartCObjectUnsupported();
+ Dart_CObject* object = AllocateDartCObjectUnsupported();
+ AddBackRef(object_id, object, kIsDeserialized);
+ return object;
}
case kTypeArgumentsCid: {
// TODO(sjesse): Remove this when message serialization format is
@@ -467,7 +472,9 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
}
default:
// Everything else not supported.
- return AllocateDartCObjectUnsupported();
+ Dart_CObject* value = AllocateDartCObjectUnsupported();
+ AddBackRef(object_id, value, kIsDeserialized);
+ return value;
}
}
« no previous file with comments | « no previous file | tests/standalone/standalone.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698