Changeset 225771 in webkit


Ignore:
Timestamp:
Dec 11, 2017 9:47:18 PM (6 years ago)
Author:
msaboff@apple.com
Message:

REGRESSION(r225683): Chakra test failure in es6/regex-unicode.js for 32bit builds
https://bugs.webkit.org/show_bug.cgi?id=180685

Reviewed by Saam Barati.

The characterClass->m_anyCharacter check at the top of checkCharacterClass() caused
the character class check to return true without reading the character. Given that
the character could be a surrogate pair, we need to read the character even if we
don't have the check it.

  • yarr/YarrInterpreter.cpp:

(JSC::Yarr::Interpreter::testCharacterClass):
(JSC::Yarr::Interpreter::checkCharacterClass):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r225768 r225771  
     12017-12-11  Michael Saboff  <msaboff@apple.com>
     2
     3        REGRESSION(r225683): Chakra test failure in es6/regex-unicode.js for 32bit builds
     4        https://bugs.webkit.org/show_bug.cgi?id=180685
     5
     6        Reviewed by Saam Barati.
     7
     8        The characterClass->m_anyCharacter check at the top of checkCharacterClass() caused
     9        the character class check to return true without reading the character.  Given that
     10        the character could be a surrogate pair, we need to read the character even if we
     11        don't have the check it.
     12
     13        * yarr/YarrInterpreter.cpp:
     14        (JSC::Yarr::Interpreter::testCharacterClass):
     15        (JSC::Yarr::Interpreter::checkCharacterClass):
     16
    1172017-12-11  Saam Barati  <sbarati@apple.com>
    218
  • trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp

    r225695 r225771  
    353353        };
    354354
     355        if (characterClass->m_anyCharacter)
     356            return true;
     357
    355358        const size_t thresholdForBinarySearch = 6;
    356359
     
    410413    bool checkCharacterClass(CharacterClass* characterClass, bool invert, unsigned negativeInputOffset)
    411414    {
    412         if (characterClass->m_anyCharacter)
    413             return !invert;
    414 
    415415        bool match = testCharacterClass(characterClass, input.readChecked(negativeInputOffset));
    416416        return invert ? !match : match;
Note: See TracChangeset for help on using the changeset viewer.