Ignore:
Timestamp:
Mar 24, 2021, 10:29:02 AM (4 years ago)
Author:
[email protected]
Message:

[YARR] Interpreter incorrectly matches non-BMP characters with multiple . w/dotAll flag
https://bugs.webkit.org/show_bug.cgi?id=223666

Reviewed by Mark Lam.

JSTests:

Added tests for dotAll. Also made sure that we test both JIT and non-JIT execution.

  • stress/regexp-dot-match-nonBMP.js:

Source/JavaScriptCore:

In checkCharacterClassDontAdvanceInputForNonBMP(), we need to check for input.readChecked() returning -1
and return that the character class didn't match.

  • yarr/YarrInterpreter.cpp:

(JSC::Yarr::Interpreter::checkCharacterClassDontAdvanceInputForNonBMP):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp

    r274806 r274945  
    437437    {
    438438        int readCharacter = characterClass->hasOnlyNonBMPCharacters() ? input.readSurrogatePairChecked(negativeInputOffset) :  input.readChecked(negativeInputOffset);
     439        if (readCharacter < 0)
     440            return false;
     441
    439442        return testCharacterClass(characterClass, readCharacter);
    440443    }
Note: See TracChangeset for help on using the changeset viewer.