Author: [EMAIL PROTECTED]
Date: Wed Oct  8 01:05:14 2008
New Revision: 468

Modified:
    branches/bleeding_edge/src/runtime.cc

Log:
Fix incorrect short cut test that assumed ASCII strings could be Latin1.
Review URL: http://codereview.chromium.org/6542

Modified: branches/bleeding_edge/src/runtime.cc
==============================================================================
--- branches/bleeding_edge/src/runtime.cc       (original)
+++ branches/bleeding_edge/src/runtime.cc       Wed Oct  8 01:05:14 2008
@@ -1086,7 +1086,11 @@
    // Notice: Doesn't include last character.
    for (int i = p < m ? m - p : 0; i < m - 1; i++) {
      uc32 c = pattern[i];
-    if (sizeof(schar) == 1 && c > 255) return -1;
+    if (sizeof(schar) == 1 &&
+        sizeof(pchar) > 1 &&
+        c > String::kMaxAsciiCharCode) {
+      return -1;
+    }
      bad_char_map[c & kBMHSignificantBitsMask] = m - 1 - i;
    }


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

Reply via email to