Check ASCIIness of lhs, not this.

In one pathalogical case it's possible to have this->IsAsciiRepresentation() &&
!this->TryFlattenGetString()->IsAsciiRepresentation()---if cons string has two byte
string which holds only ascii chars and second is an empty string.  In this case we
would return first which is not AsciiRepresentation(), however cons is.

Review URL: http://codereview.chromium.org/3036046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5188 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
antonm@chromium.org 2010-08-05 18:12:39 +00:00
parent 1844e149ab
commit 300580d5d8

View File

@ -4738,7 +4738,7 @@ bool String::SlowEquals(String* other) {
}
if (lhs->IsFlat()) {
if (IsAsciiRepresentation()) {
if (lhs->IsAsciiRepresentation()) {
Vector<const char> vec1 = lhs->ToAsciiVector();
if (rhs->IsFlat()) {
if (rhs->IsAsciiRepresentation()) {