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

Issue 2400523003: Fix bad canonicalization for strings whose utf32->utf16 conversion is lossy. (Closed)

Created:
4 years, 2 months ago by rmacnak
Modified:
4 years, 2 months ago
Reviewers:
siva, hausner
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix bad canonicalization for strings whose utf32->utf16 conversion is lossy. Changes String::Equals(utf32) from string.AsUtf32().Equals(utf32) to string.Equals(utf32.AsUtf16()). Fixes #27433. R=hausner@google.com Committed: https://github.com/dart-lang/sdk/commit/1cba15030716c784a040047ce6e8514883134213

Patch Set 1 #

Total comments: 4

Patch Set 2 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -14 lines) Patch
M runtime/vm/object.cc View 1 chunk +13 lines, -11 lines 0 comments Download
M runtime/vm/object_test.cc View 1 1 chunk +15 lines, -0 lines 0 comments Download
M tests/language/language.status View 1 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
rmacnak
4 years, 2 months ago (2016-10-06 21:31:43 UTC) #2
hausner
LGTM https://codereview.chromium.org/2400523003/diff/1/runtime/vm/object_test.cc File runtime/vm/object_test.cc (right): https://codereview.chromium.org/2400523003/diff/1/runtime/vm/object_test.cc#newcode4730 runtime/vm/object_test.cc:4730: VM_TEST_CASE(String_EqualsUTF32) { Maybe a short comment what is ...
4 years, 2 months ago (2016-10-06 22:14:42 UTC) #3
rmacnak
https://codereview.chromium.org/2400523003/diff/1/runtime/vm/object_test.cc File runtime/vm/object_test.cc (right): https://codereview.chromium.org/2400523003/diff/1/runtime/vm/object_test.cc#newcode4730 runtime/vm/object_test.cc:4730: VM_TEST_CASE(String_EqualsUTF32) { On 2016/10/06 22:14:41, hausner wrote: > Maybe ...
4 years, 2 months ago (2016-10-06 23:16:29 UTC) #4
rmacnak
Committed patchset #2 (id:20001) manually as 1cba15030716c784a040047ce6e8514883134213 (presubmit successful).
4 years, 2 months ago (2016-10-06 23:16:57 UTC) #6
siva
4 years, 2 months ago (2016-10-06 23:37:24 UTC) #7
Message was sent while issue was closed.
DBC

https://codereview.chromium.org/2400523003/diff/1/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/2400523003/diff/1/runtime/vm/object.cc#newcod...
runtime/vm/object.cc:20106: if (j + 1 >= Length()) return false;
((j + 1) >= ... to maintain our style.

https://codereview.chromium.org/2400523003/diff/1/runtime/vm/object.cc#newcod...
runtime/vm/object.cc:20114: return j == Length();
The compiler maybe doing this optimization but I was wondering it it might make
sense to cache Length() in a local variable at the top
and also would this check at the start be valid?
if ((len < 0) || (len > Length())) return false;

Powered by Google App Engine
This is Rietveld 408576698