Changeset 243967 in webkit


Ignore:
Timestamp:
Apr 7, 2019 4:24:45 PM (5 years ago)
Author:
msaboff@apple.com
Message:

REGRESSION (r243642): Crash in reddit.com page
https://bugs.webkit.org/show_bug.cgi?id=196684

Reviewed by Geoffrey Garen.

JSTests:

New regression test.

  • stress/regexp-nongreedy-charclass-backtracks.js: Added.

Source/JavaScriptCore:

In r243642, the code that saves and restores the count for non-greedy character classes
was inadvertently put inside an if statement. This code should be generated for all
non-greedy character classes.

  • yarr/YarrJIT.cpp:

(JSC::Yarr::YarrGenerator::generateCharacterClassNonGreedy):
(JSC::Yarr::YarrGenerator::backtrackCharacterClassNonGreedy):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r243966 r243967  
     12019-04-07  Michael Saboff  <msaboff@apple.com>
     2
     3        REGRESSION (r243642): Crash in reddit.com page
     4        https://bugs.webkit.org/show_bug.cgi?id=196684
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        New regression test.
     9
     10        * stress/regexp-nongreedy-charclass-backtracks.js: Added.
     11
    1122019-04-07  Yusuke Suzuki  <ysuzuki@apple.com>
    213
  • trunk/Source/JavaScriptCore/ChangeLog

    r243966 r243967  
     12019-04-07  Michael Saboff  <msaboff@apple.com>
     2
     3        REGRESSION (r243642): Crash in reddit.com page
     4        https://bugs.webkit.org/show_bug.cgi?id=196684
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        In r243642, the code that saves and restores the count for non-greedy character classes
     9        was inadvertently put inside an if statement.  This code should be generated for all
     10        non-greedy character classes.
     11
     12        * yarr/YarrJIT.cpp:
     13        (JSC::Yarr::YarrGenerator::generateCharacterClassNonGreedy):
     14        (JSC::Yarr::YarrGenerator::backtrackCharacterClassNonGreedy):
     15
    1162019-04-07  Yusuke Suzuki  <ysuzuki@apple.com>
    217
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp

    r243839 r243967  
    19441944        move(TrustedImm32(0), countRegister);
    19451945        op.m_reentry = label();
     1946
     1947#ifdef JIT_UNICODE_EXPRESSIONS
    19461948        if (m_decodeSurrogatePairs) {
    19471949            if (!term->characterClass->hasOneCharacterSize() || term->invert())
    19481950                storeToFrame(index, term->frameLocation + BackTrackInfoCharacterClass::beginIndex());
    1949             storeToFrame(countRegister, term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex());
    1950         }
     1951        }
     1952#endif
     1953
     1954        storeToFrame(countRegister, term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex());
    19511955    }
    19521956
     
    19671971            if (!term->characterClass->hasOneCharacterSize() || term->invert())
    19681972                loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::beginIndex(), index);
    1969             loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex(), countRegister);
    1970         }
    1971 #endif
     1973        }
     1974#endif
     1975
     1976        loadFromFrame(term->frameLocation + BackTrackInfoCharacterClass::matchAmountIndex(), countRegister);
    19721977
    19731978        nonGreedyFailures.append(atEndOfInput());
Note: See TracChangeset for help on using the changeset viewer.