mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
Fix issue with serializing typed array views
This makes the code void isolate() { port.receive(print); } main() { Uint8List list = new Uint8List(1); spawnFunction(isolate).send([1, new Uint8List.view(list.buffer, 0, 1)]); } not crash. R=asiva@google.com BUG= Review URL: https://codereview.chromium.org//13866012 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@21200 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
parent
7c56d46086
commit
6082783a04
1 changed files with 5 additions and 9 deletions
|
@ -980,6 +980,10 @@ void SnapshotWriter::WriteObjectRef(RawObject* raw) {
|
|||
|
||||
return;
|
||||
}
|
||||
if (RawObject::IsTypedDataViewClassId(class_id)) {
|
||||
WriteInstanceRef(raw, cls);
|
||||
return;
|
||||
}
|
||||
// Object is being referenced, add it to the forward ref list and mark
|
||||
// it so that future references to this object in the snapshot will use
|
||||
// this object id. Mark it as not having been serialized yet so that we
|
||||
|
@ -1013,15 +1017,6 @@ void SnapshotWriter::WriteObjectRef(RawObject* raw) {
|
|||
raw_obj->WriteTo(this, object_id, kind_);
|
||||
return;
|
||||
}
|
||||
#undef SNAPSHOT_WRITE
|
||||
#define SNAPSHOT_WRITE(clazz) \
|
||||
case kTypedData##clazz##ViewCid: \
|
||||
|
||||
CLASS_LIST_TYPED_DATA(SNAPSHOT_WRITE)
|
||||
case kByteDataViewCid: {
|
||||
WriteInstanceRef(raw, cls);
|
||||
return;
|
||||
}
|
||||
#undef SNAPSHOT_WRITE
|
||||
default: break;
|
||||
}
|
||||
|
@ -1088,6 +1083,7 @@ intptr_t SnapshotWriter::MarkObject(RawObject* raw, SerializeState state) {
|
|||
value = SerializedHeaderTag::update(kObjectId, value);
|
||||
value = SerializedHeaderData::update(object_id, value);
|
||||
uword tags = raw->ptr()->tags_;
|
||||
ASSERT(SerializedHeaderTag::decode(tags) != kObjectId);
|
||||
raw->ptr()->tags_ = value;
|
||||
ForwardObjectNode* node = new ForwardObjectNode(raw, tags, state);
|
||||
ASSERT(node != NULL);
|
||||
|
|
Loading…
Reference in a new issue