Check ASCIIness of lhs, not this.
authorantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 5 Aug 2010 18:12:39 +0000 (18:12 +0000)
committerantonm@chromium.org <antonm@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 5 Aug 2010 18:12:39 +0000 (18:12 +0000)
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

src/objects.cc

index 7a08eec..4e20959 100644 (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()) {