Ignore:
Timestamp:
Feb 15, 2019, 5:13:57 PM (6 years ago)
Author:
[email protected]
Message:

RELEASE_ASSERT at com.apple.JavaScriptCore: JSC::jsSubstringOfResolved
https://bugs.webkit.org/show_bug.cgi?id=194558

Reviewed by Saam Barati.

JSTests:

New regression test.

  • stress/regexp-unicode-within-string.js: Added.

Source/JavaScriptCore:

Added an in bounds check before the read of the next character for Unicode regular expressions
for pattern generation that didn't already have such checks.

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::generatePatternCharacterOnce):
(JSC::Yarr::YarrGenerator::generatePatternCharacterFixed):
(JSC::Yarr::YarrGenerator::generateCharacterClassOnce):
(JSC::Yarr::YarrGenerator::generateCharacterClassFixed):

File:
1 edited

Legend:

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

    r240641 r241634  
    14291429        }
    14301430
     1431        if (m_decodeSurrogatePairs)
     1432            op.m_jumps.append(jumpIfNoAvailableInput());
     1433
    14311434        if (m_charSize == Char8) {
    14321435            auto check1 = [&] (Checked<unsigned> offset, UChar32 characters) {
     
    15611564        const RegisterID countRegister = regT1;
    15621565
     1566        if (m_decodeSurrogatePairs)
     1567            op.m_jumps.append(jumpIfNoAvailableInput());
     1568
    15631569        move(index, countRegister);
    15641570        Checked<unsigned> scaledMaxCount = term->quantityMaxCount;
     
    17141720        const RegisterID character = regT0;
    17151721
    1716         if (m_decodeSurrogatePairs)
     1722        if (m_decodeSurrogatePairs) {
     1723            op.m_jumps.append(jumpIfNoAvailableInput());
    17171724            storeToFrame(index, term->frameLocation + BackTrackInfoCharacterClass::beginIndex());
     1725        }
    17181726
    17191727        JumpList matchDest;
     
    17611769        const RegisterID character = regT0;
    17621770        const RegisterID countRegister = regT1;
     1771
     1772        if (m_decodeSurrogatePairs)
     1773            op.m_jumps.append(jumpIfNoAvailableInput());
    17631774
    17641775        move(index, countRegister);
Note: See TracChangeset for help on using the changeset viewer.