Changeset 74309 in webkit


Ignore:
Timestamp:
Dec 17, 2010 6:01:13 PM (13 years ago)
Author:
msaboff@apple.com
Message:

2010-12-17 Michael Saboff <msaboff@apple.com>

Reviewed by Oliver Hunt.

RegExp Jit'ed expression crashes clicking link on yelp.com
https://bugs.webkit.org/show_bug.cgi?id=51284

When transitioning between an non-repeating beginning of line
anchored expression and the remaining refactored repeating
expression, we should not clear any residual datalabel in
state's m_backtrack. It will be resolved and cleared in subsequent
code when linkAlternativeBacktracks() is called for the repeating
alternative(s).

  • yarr/RegexJIT.cpp: (JSC::Yarr::RegexGenerator::BacktrackDestination::clear): (JSC::Yarr::RegexGenerator::TermGenerationState::clearBacktrack):

2010-12-17 Michael Saboff <msaboff@apple.com>

Reviewed by Oliver Hunt.

RegExp Jit'ed expression crashes clicking link on yelp.com
https://bugs.webkit.org/show_bug.cgi?id=51284

New tests to validate changes made in regex JIT.

  • fast/regex/parentheses-expected.txt:
  • fast/regex/script-tests/parentheses.js:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r74308 r74309  
     12010-12-17  Michael Saboff  <msaboff@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        RegExp Jit'ed expression crashes clicking link on yelp.com
     6        https://bugs.webkit.org/show_bug.cgi?id=51284
     7
     8        When transitioning between an non-repeating beginning of line
     9        anchored expression and the remaining refactored repeating
     10        expression, we should not clear any residual datalabel in
     11        state's m_backtrack.  It will be resolved and cleared in subsequent
     12        code when linkAlternativeBacktracks() is called for the repeating
     13        alternative(s).
     14
     15        * yarr/RegexJIT.cpp:
     16        (JSC::Yarr::RegexGenerator::BacktrackDestination::clear):
     17        (JSC::Yarr::RegexGenerator::TermGenerationState::clearBacktrack):
     18
    1192010-12-17  Dan Bernstein  <mitz@apple.com>
    220
  • trunk/JavaScriptCore/yarr/RegexJIT.cpp

    r73962 r74309  
    487487        }
    488488
    489         void clear()
     489        void clear(bool doDataLabelClear = true)
    490490        {
    491491            m_backtrackType = NoBacktrack;
    492             clearDataLabel();
     492            if (doDataLabelClear)
     493                clearDataLabel();
    493494            m_nextBacktrack = 0;
    494495        }
     
    868869        void clearBacktrack()
    869870        {
    870             m_backtrack.clear();
     871            m_backtrack.clear(false);
    871872            m_linkedBacktrack = 0;
    872873        }
  • trunk/LayoutTests/ChangeLog

    r74305 r74309  
     12010-12-17  Michael Saboff  <msaboff@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        RegExp Jit'ed expression crashes clicking link on yelp.com
     6        https://bugs.webkit.org/show_bug.cgi?id=51284
     7
     8        New tests to validate changes made in regex JIT.
     9
     10        * fast/regex/parentheses-expected.txt:
     11        * fast/regex/script-tests/parentheses.js:
     12
    1132010-12-17  Jessie Berlin  <jberlin@apple.com>
    214
  • trunk/LayoutTests/fast/regex/parentheses-expected.txt

    r73962 r74309  
    3939PASS regexp32.exec('Committer:') is null
    4040PASS regexp33.exec('> <head>') is ['>',undefined,undefined,'>']
     41PASS regexp34.exec('xyz123') is null
     42PASS regexp34.exec('btn-abc') is ['btn-abc']
     43PASS regexp34.exec('btn- abc') is null
     44PASS regexp34.exec('XXbtn-abc') is null
     45PASS regexp34.exec('XX btn-abc') is ['btn-abc']
    4146PASS 'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/) is ['Bob',undefined,'Bob',undefined,undefined]
    4247PASS successfullyParsed is true
  • trunk/LayoutTests/fast/regex/script-tests/parentheses.js

    r73962 r74309  
    141141shouldBe("regexp33.exec('> <head>')","['>',undefined,undefined,'>']");
    142142
     143var regexp34 = /(?:^|\b)btn-\S+/;
     144shouldBeNull("regexp34.exec('xyz123')");
     145shouldBe("regexp34.exec('btn-abc')","['btn-abc']");
     146shouldBeNull("regexp34.exec('btn- abc')");
     147shouldBeNull("regexp34.exec('XXbtn-abc')");
     148shouldBe("regexp34.exec('XX btn-abc')","['btn-abc']");
     149
    143150shouldBe("'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/)", "['Bob',undefined,'Bob',undefined,undefined]");
    144151
Note: See TracChangeset for help on using the changeset viewer.