Changeset 76407 in webkit


Ignore:
Timestamp:
Jan 21, 2011 3:52:29 PM (13 years ago)
Author:
msaboff@apple.com
Message:

2011-01-21 Michael Saboff <msaboff@apple.com>

Reviewed by Oliver Hunt.

[RegexFuzz] Hang with forward assertion
https://bugs.webkit.org/show_bug.cgi?id=52825
<rdar://problem/8894332>

The backtrackTo label from the first term in a list of terms is
being overwritten by processing of subsequent terms. Changed
copyBacktrackToLabel() to check for an existing bcaktrackTo label
before copying and renamed it to propagateBacktrackToLabel() since
it no longer copies.

  • yarr/YarrJIT.cpp: (JSC::Yarr::YarrGenerator::BacktrackDestination::propagateBacktrackToLabel): (JSC::Yarr::YarrGenerator::generateParenthesesSingle):

2011-01-21 Michael Saboff <msaboff@apple.com>

Reviewed by Oliver Hunt.

[RegexFuzz] Hang with forward assertion
https://bugs.webkit.org/show_bug.cgi?id=52825
<rdar://problem/8894332>

New tests to check for functionality and future regression.

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

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r76404 r76407  
     12011-01-21  Michael Saboff  <msaboff@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        [RegexFuzz] Hang with forward assertion
     6        https://bugs.webkit.org/show_bug.cgi?id=52825
     7        <rdar://problem/8894332>
     8
     9        New tests to check for functionality and future regression.
     10
     11        * fast/regex/parentheses-expected.txt:
     12        * fast/regex/script-tests/parentheses.js:
     13
    1142011-01-21  Maciej Stachowiak  <mjs@apple.com>
    215
  • trunk/LayoutTests/fast/regex/parentheses-expected.txt

    r76275 r76407  
    7676PASS regexp44.exec('SSS') is ['',undefined]
    7777PASS regexp45.exec('vt') is null
     78PASS regexp46.exec('5') is null
     79PASS regexp46.exec('pk') is ['pk',undefined,undefined]
     80PASS regexp46.exec('Xw555') is ['w555','w',undefined]
     81PASS regexp46.exec('Xw55pk5') is ['w','w','']
    7882PASS 'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/) is ['Bob',undefined,'Bob',undefined,undefined]
    7983PASS successfullyParsed is true
  • trunk/LayoutTests/fast/regex/script-tests/parentheses.js

    r76275 r76407  
    203203shouldBeNull("regexp45.exec('vt')");
    204204
     205var regexp46 = /(w)(?:5{3}|())|pk/;
     206shouldBeNull("regexp46.exec('5')");
     207shouldBe("regexp46.exec('pk')", "['pk',undefined,undefined]");
     208shouldBe("regexp46.exec('Xw555')", "['w555','w',undefined]");
     209shouldBe("regexp46.exec('Xw55pk5')", "['w','w','']");
     210
    205211shouldBe("'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/)", "['Bob',undefined,'Bob',undefined,undefined]");
    206212
  • trunk/Source/JavaScriptCore/ChangeLog

    r76399 r76407  
     12011-01-21  Michael Saboff  <msaboff@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        [RegexFuzz] Hang with forward assertion
     6        https://bugs.webkit.org/show_bug.cgi?id=52825
     7        <rdar://problem/8894332>
     8
     9        The backtrackTo label from the first term in a list of terms is
     10        being overwritten by processing of subsequent terms.  Changed
     11        copyBacktrackToLabel() to check for an existing bcaktrackTo label
     12        before copying and renamed it to propagateBacktrackToLabel() since
     13        it no longer copies.
     14
     15        * yarr/YarrJIT.cpp:
     16        (JSC::Yarr::YarrGenerator::BacktrackDestination::propagateBacktrackToLabel):
     17        (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
     18
    1192011-01-21  Geoffrey Garen  <ggaren@apple.com>
    220
  • trunk/Source/JavaScriptCore/yarr/YarrJIT.cpp

    r76275 r76407  
    607607        }
    608608
    609         void copyBacktrackToLabel(BacktrackDestination& rhs)
    610         {
    611             if (rhs.m_backtrackToLabel)
     609        void propagateBacktrackToLabel(const BacktrackDestination& rhs)
     610        {
     611            if (!m_backtrackToLabel && rhs.m_backtrackToLabel)
    612612                m_backtrackToLabel = rhs.m_backtrackToLabel;
    613613        }
     
    16621662
    16631663            state.propagateBacktrackingFrom(this, parenthesesBacktrack);
    1664             stateBacktrack.copyBacktrackToLabel(parenthesesBacktrack);
     1664            stateBacktrack.propagateBacktrackToLabel(parenthesesBacktrack);
    16651665
    16661666            m_expressionState.decrementParenNestingLevel();
Note: See TracChangeset for help on using the changeset viewer.