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

Issue 2858033: Fix Chromium issue 47824. (Closed)

Created:
10 years, 5 months ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Fix Chromium issue 47824. In rare cases a two-byte string was mistaken for an ascii-string.

Patch Set 1 #

Total comments: 4

Patch Set 2 : Addressed review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+188 lines, -63 lines) Patch
M src/handles.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/handles.cc View 1 chunk +10 lines, -0 lines 0 comments Download
M src/jsregexp.cc View 3 chunks +16 lines, -2 lines 0 comments Download
M src/objects.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/regexp-macro-assembler.cc View 2 chunks +1 line, -3 lines 0 comments Download
M src/runtime.cc View 3 chunks +28 lines, -12 lines 0 comments Download
M test/cctest/test-api.cc View 1 30 chunks +126 lines, -45 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Lasse Reichstein
10 years, 5 months ago (2010-06-29 13:56:07 UTC) #1
Mads Ager (chromium)
LGTM, thanks for fixing this.
10 years, 5 months ago (2010-06-29 14:20:09 UTC) #2
Vitaly Repeshko
LGTM. Thanks a lot for fixing this! I'm afraid I broke it in r4894: bool ...
10 years, 5 months ago (2010-06-29 14:36:31 UTC) #3
Lasse Reichstein
10 years, 5 months ago (2010-06-30 07:14:41 UTC) #4
Reversing the change to ConstString::IsAsciiRepresentation would probably have
been an easier fix, but I think this is the better one.

http://codereview.chromium.org/2858033/diff/1/5
File test/cctest/test-api.cc (right):

http://codereview.chromium.org/2858033/diff/1/5#newcode10980
test/cctest/test-api.cc:10980: i::String::cast(string->TryFlatten());
Only if flattening succeeds, otherwise it just returns the original cons-string.
Likewise for TryFlatten, which returns the failure if flattenings fails.

I have added a new FlattenGetString that flattens unconditionally and returns
the non-cons string instead.

http://codereview.chromium.org/2858033/diff/1/5#newcode10985
test/cctest/test-api.cc:10985: uint16_t *uc16_buffer = new uint16_t[length + 1];
Good catch. Fixed.

Powered by Google App Engine
This is Rietveld 408576698