Ignore:
Timestamp:
Aug 6, 2014, 10:27:41 AM (11 years ago)
Author:
Dániel Bátyai
Message:

[ARM] Incorrect handling of Unicode characters
https://bugs.webkit.org/show_bug.cgi?id=135380

Reviewed by Darin Adler.

Removed erroneous fast case from stringFromUTF(), since it assumed that
char is always implemented as signed.

  • jsc.cpp:

(stringFromUTF):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r172129 r172152  
    662662static inline String stringFromUTF(const char* utf8)
    663663{
    664     // Find the the first non-ascii character, or nul.
    665     const char* pos = utf8;
    666     while (*pos > 0)
    667         pos++;
    668     size_t asciiLength = pos - utf8;
    669    
    670     // Fast case - string is all ascii.
    671     if (!*pos)
    672         return String(utf8, asciiLength);
    673    
    674     // Slow case - contains non-ascii characters, use fromUTF8WithLatin1Fallback.
    675     ASSERT(*pos < 0);
    676     ASSERT(strlen(utf8) == asciiLength + strlen(pos));
    677     return String::fromUTF8WithLatin1Fallback(utf8, asciiLength + strlen(pos));
     664    return String::fromUTF8WithLatin1Fallback(utf8, strlen(utf8));
    678665}
    679666
Note: See TracChangeset for help on using the changeset viewer.