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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 51393002: Raise an exception instead of crashing when attempting to pass a MirrorReference between isolates. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/isolate/illegal_msg_function_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index e714f449257bcf527a5473efb9ac2da16ab4c41c..27ad524978ff13f4f4d9fcf8d8afb34ab0ad70b8 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -2654,7 +2654,14 @@ RawMirrorReference* MirrorReference::ReadFrom(SnapshotReader* reader,
void RawMirrorReference::WriteTo(SnapshotWriter* writer,
intptr_t object_id,
Snapshot::Kind kind) {
- UNREACHABLE();
+ if (kind == Snapshot::kMessage) {
+ // We do not allow objects with native fields in an isolate message.
+ writer->SetWriteException(Exceptions::kArgument,
+ "Illegal argument in isolate message"
+ " : (object is a MirrorReference)");
+ } else {
+ UNREACHABLE();
+ }
}
} // namespace dart
« no previous file with comments | « no previous file | tests/isolate/illegal_msg_function_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698