Chromium Code Reviews| 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 " |