| Index: runtime/vm/dart_api_message.cc
|
| diff --git a/runtime/vm/dart_api_message.cc b/runtime/vm/dart_api_message.cc
|
| index 123d5352a67b994dbd2891d9939206ba2896b63c..8f089d3764283a13bad31de27fa453042558f801 100644
|
| --- a/runtime/vm/dart_api_message.cc
|
| +++ b/runtime/vm/dart_api_message.cc
|
| @@ -600,12 +600,16 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
|
| return object;
|
| }
|
|
|
| -#define READ_TYPED_DATA(type, ctype) \
|
| - { \
|
| +#define READ_TYPED_DATA_HEADER(type) \
|
| intptr_t len = ReadSmiValue(); \
|
| Dart_CObject* object = \
|
| - AllocateDartCObjectTypedData(Dart_TypedData_k##type, len); \
|
| + AllocateDartCObjectTypedData(Dart_TypedData_k##type, len); \
|
| AddBackRef(object_id, object, kIsDeserialized); \
|
| +
|
| +
|
| +#define READ_TYPED_DATA(type, ctype) \
|
| + { \
|
| + READ_TYPED_DATA_HEADER(type); \
|
| if (len > 0) { \
|
| ctype* p = \
|
| reinterpret_cast<ctype*>(object->value.as_typed_data.values); \
|
| @@ -617,12 +621,26 @@ Dart_CObject* ApiMessageReader::ReadInternalVMObject(intptr_t class_id,
|
| } \
|
|
|
| case kTypedDataInt8ArrayCid:
|
| - case kExternalTypedDataInt8ArrayCid:
|
| - READ_TYPED_DATA(Int8, int8_t);
|
| + case kExternalTypedDataInt8ArrayCid: {
|
| + READ_TYPED_DATA_HEADER(Int8);
|
| + if (len > 0) {
|
| + uint8_t* p =
|
| + reinterpret_cast<uint8_t*>(object->value.as_typed_data.values);
|
| + ReadBytes(p, len);
|
| + }
|
| + return object;
|
| + }
|
|
|
| case kTypedDataUint8ArrayCid:
|
| - case kExternalTypedDataUint8ArrayCid:
|
| - READ_TYPED_DATA(Uint8, uint8_t);
|
| + case kExternalTypedDataUint8ArrayCid: {
|
| + READ_TYPED_DATA_HEADER(Uint8);
|
| + if (len > 0) {
|
| + uint8_t* p =
|
| + reinterpret_cast<uint8_t*>(object->value.as_typed_data.values);
|
| + ReadBytes(p, len);
|
| + }
|
| + return object;
|
| + }
|
|
|
| case kTypedDataUint8ClampedArrayCid:
|
| case kExternalTypedDataUint8ClampedArrayCid:
|
|
|