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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 11411204: When externalizing a string ensure that the basic tag bits are preserved. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 15532)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -1749,6 +1749,11 @@
if (array == NULL) {
RETURN_NULL_ERROR(array);
}
+ Heap* vm_isolate_heap = Dart::vm_isolate()->heap();
+ if (vm_isolate_heap->Contains(reinterpret_cast<uword>(str_obj.raw()))) {
cshapiro 2012/11/29 21:03:12 Is this the most efficient check? Can we use the
siva 2012/11/29 22:37:39 My initial thought was strings in the isolate can
+ return Api::NewError("Dart_MakeExternalString "
+ "cannot externalize a read only string.");
cshapiro 2012/11/29 21:03:12 s/read only/read-only/
siva 2012/11/29 22:37:39 Done.
+ }
intptr_t str_size = (str_obj.Length() * str_obj.CharSize());
if ((length < str_size) || (length > String::kMaxElements)) {
return Api::NewError("Dart_MakeExternalString "
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698