Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index f8133efa01441bf6c2a1b3e9a705498c4d8cb102..73e7e16c5cc1676a864f2bbc0655b62b19447193 100644 |
--- a/runtime/vm/isolate.cc |
+++ b/runtime/vm/isolate.cc |
@@ -468,24 +468,28 @@ MessageHandler::MessageStatus IsolateMessageHandler::HandleMessage( |
} |
// Parse the message. |
- MessageSnapshotReader reader(message->data(), message->len(), thread); |
- const Object& msg_obj = Object::Handle(zone, reader.ReadObject()); |
- if (msg_obj.IsError()) { |
- // An error occurred while reading the message. |
- delete message; |
- return ProcessUnhandledException(Error::Cast(msg_obj)); |
- } |
- if (!msg_obj.IsNull() && !msg_obj.IsInstance()) { |
- // TODO(turnidge): We need to decide what an isolate does with |
- // malformed messages. If they (eventually) come from a remote |
- // machine, then it might make sense to drop the message entirely. |
- // In the case that the message originated locally, which is |
- // always true for now, then this should never occur. |
- UNREACHABLE(); |
- } |
- |
Instance& msg = Instance::Handle(zone); |
- msg ^= msg_obj.raw(); // Can't use Instance::Cast because may be null. |
+ if (message->type() == Message::kDataType) { |
+ MessageSnapshotReader reader(message->data(), message->len(), thread); |
+ const Object& msg_obj = Object::Handle(zone, reader.ReadObject()); |
+ if (msg_obj.IsError()) { |
+ // An error occurred while reading the message. |
+ delete message; |
+ return ProcessUnhandledException(Error::Cast(msg_obj)); |
+ } |
+ if (!msg_obj.IsNull() && !msg_obj.IsInstance()) { |
+ // TODO(turnidge): We need to decide what an isolate does with |
+ // malformed messages. If they (eventually) come from a remote |
+ // machine, then it might make sense to drop the message entirely. |
+ // In the case that the message originated locally, which is |
+ // always true for now, then this should never occur. |
+ UNREACHABLE(); |
+ } |
+ msg ^= msg_obj.raw(); // Can't use Instance::Cast because may be null. |
+ } else { |
+ ASSERT(message->type() == Message::kIntegerType); |
+ msg ^= Smi::New(message->integer()); |
+ } |
MessageStatus status = kOK; |
if (message->IsOOB()) { |