Commit bb3b3ae4 authored by msaboff@apple.com's avatar msaboff@apple.com

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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3fa7c3dc
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:
2011-01-21 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adele Peterson.
......
......@@ -75,6 +75,10 @@ PASS /(?!(?=r{0}){2,})|((z)?)?/gi.test('') is true
PASS regexp43.exec('SSS') is ['']
PASS regexp44.exec('SSS') is ['',undefined]
PASS regexp45.exec('vt') is null
PASS regexp46.exec('5') is null
PASS regexp46.exec('pk') is ['pk',undefined,undefined]
PASS regexp46.exec('Xw555') is ['w555','w',undefined]
PASS regexp46.exec('Xw55pk5') is ['w','w','']
PASS 'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/) is ['Bob',undefined,'Bob',undefined,undefined]
PASS successfullyParsed is true
......
......@@ -202,6 +202,12 @@ shouldBe("regexp44.exec('SSS')", "['',undefined]");
var regexp45 = /((?!(?:|)v{2,}|))/;
shouldBeNull("regexp45.exec('vt')");
var regexp46 = /(w)(?:5{3}|())|pk/;
shouldBeNull("regexp46.exec('5')");
shouldBe("regexp46.exec('pk')", "['pk',undefined,undefined]");
shouldBe("regexp46.exec('Xw555')", "['w555','w',undefined]");
shouldBe("regexp46.exec('Xw55pk5')", "['w','w','']");
shouldBe("'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/)", "['Bob',undefined,'Bob',undefined,undefined]");
var successfullyParsed = true;
......
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 Geoffrey Garen <ggaren@apple.com>
Reviewed by Sam Weinig.
......
......@@ -606,9 +606,9 @@ class YarrGenerator : private MacroAssembler {
m_nextBacktrack->setLabel(label);
}
void copyBacktrackToLabel(BacktrackDestination& rhs)
void propagateBacktrackToLabel(const BacktrackDestination& rhs)
{
if (rhs.m_backtrackToLabel)
if (!m_backtrackToLabel && rhs.m_backtrackToLabel)
m_backtrackToLabel = rhs.m_backtrackToLabel;
}
......@@ -1661,7 +1661,7 @@ class YarrGenerator : private MacroAssembler {
BacktrackDestination& stateBacktrack = state.getBacktrackDestination();
state.propagateBacktrackingFrom(this, parenthesesBacktrack);
stateBacktrack.copyBacktrackToLabel(parenthesesBacktrack);
stateBacktrack.propagateBacktrackToLabel(parenthesesBacktrack);
m_expressionState.decrementParenNestingLevel();
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment