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

Unified Diff: runtime/vm/snapshot.cc

Issue 14348005: Fix for issue 9617, throw a snapshot write error when encountering stacktrace objects instead of an… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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 | « runtime/vm/snapshot.h ('k') | tests/isolate/stacktrace_message_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
===================================================================
--- runtime/vm/snapshot.cc (revision 21696)
+++ runtime/vm/snapshot.cc (working copy)
@@ -1318,24 +1318,28 @@
void SnapshotWriter::CheckIfSerializable(RawClass* cls) {
if (Class::IsSignatureClass(cls)) {
// We do not allow closure objects in an isolate message.
- set_exception_type(Exceptions::kArgument);
- // TODO(6726): Allocate these constant strings once in the VM isolate.
- set_exception_msg("Illegal argument in isolate message"
+ SetWriteException(Exceptions::kArgument,
+ "Illegal argument in isolate message"
" : (object is a closure)");
- Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
}
if (cls->ptr()->num_native_fields_ != 0) {
// We do not allow objects with native fields in an isolate message.
- set_exception_type(Exceptions::kArgument);
- // TODO(6726): Allocate these constant strings once in the VM isolate.
- set_exception_msg("Illegal argument in isolate message"
+ SetWriteException(Exceptions::kArgument,
+ "Illegal argument in isolate message"
" : (object extends NativeWrapper)");
-
- Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
}
}
+void SnapshotWriter::SetWriteException(Exceptions::ExceptionType type,
+ const char* msg) {
+ set_exception_type(type);
+ // TODO(6726): Allocate these constant strings once in the VM isolate.
+ set_exception_msg(msg);
+ Isolate::Current()->long_jump_base()->Jump(1, *ErrorHandle());
+}
+
+
void SnapshotWriter::WriteInstance(intptr_t object_id,
RawObject* raw,
RawClass* cls,
« no previous file with comments | « runtime/vm/snapshot.h ('k') | tests/isolate/stacktrace_message_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698