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

Unified Diff: vm/dart_api_impl.cc

Issue 11275107: Fix length computation in Dart_StringToUTF8. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
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
« bin/builtin_natives.cc ('K') | « bin/builtin_natives.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_api_impl.cc
===================================================================
--- vm/dart_api_impl.cc (revision 14418)
+++ vm/dart_api_impl.cc (working copy)
@@ -1669,7 +1669,7 @@
if (str_obj.IsNull()) {
RETURN_TYPE_ERROR(isolate, str, String);
}
- intptr_t str_len = str_obj.Length();
+ intptr_t str_len = Utf8::Length(str_obj);
Bill Hesse 2012/11/01 20:38:01 There is still no way for the user to know the len
siva 2012/11/01 21:23:03 I have changed the API to do a scope allocation in
if (str_len > *length) {
Bill Hesse 2012/11/01 20:38:01 I think this is not enough. There is no way for t
siva 2012/11/01 21:23:03 Check removed. On 2012/11/01 20:38:01, Bill Hesse
return Api::NewError("Input array is not large enough to hold the result");
}
« bin/builtin_natives.cc ('K') | « bin/builtin_natives.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698