Reviewers: Vitaly,

Message:
Vitaly,

may you have a look?

Description:
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.

Please review this at http://codereview.chromium.org/3036046/show

Affected files:
  M src/objects.cc


Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 7a08eec3fb5e341b070751c24e7c26eb2f9a04f8..4e20959a7a8c4b7bb6dae90feaba0e8e346865e0 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -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()) {


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to