[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

msaboff at apple.com msaboff at apple.com
Sun Feb 20 23:12:37 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit 69e68d35ae4e88524f1967fa45aa3b69faf8bebe
Author: msaboff at apple.com <msaboff at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 18 23:31:30 2011 +0000

    2011-01-18  Michael Saboff  <msaboff at apple.com>
    
            Reviewed by Oliver Hunt.
    
            <rdar://problem/8875432> Regression: Some text-only e-mails cause hang beneath RegExp::match (52540)
            https://bugs.webkit.org/show_bug.cgi?id=52540
            https://bugs.webkit.org/show_bug.cgi?id=52662
    
            Directly use backtrack label with parentheses nested under a
            non-capturing parentheses.  Also linked current parentheses
            tail code object for possible parens nested within a non-capturing
            parentheses.
    
            * yarr/YarrJIT.cpp:
            (JSC::Yarr::YarrGenerator::BacktrackDestination::linkBacktrackToLabel):
            (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
    2011-01-18  Michael Saboff  <msaboff at apple.com>
    
            Reviewed by Oliver Hunt.
    
            <rdar://problem/8875432> Regression: Some text-only e-mails cause hang beneath RegExp::match (52540)
            https://bugs.webkit.org/show_bug.cgi?id=52540
            https://bugs.webkit.org/show_bug.cgi?id=52662
    
            New tests to check for proper linking of parentheses nested under
            a non-capturing parentheses.
    
            * fast/regex/parentheses-expected.txt:
            * fast/regex/script-tests/parentheses.js:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76076 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 64f751e..322aa83 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2011-01-18  Michael Saboff  <msaboff at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        <rdar://problem/8875432> Regression: Some text-only e-mails cause hang beneath RegExp::match (52540)
+        https://bugs.webkit.org/show_bug.cgi?id=52540
+        https://bugs.webkit.org/show_bug.cgi?id=52662
+
+        New tests to check for proper linking of parentheses nested under
+        a non-capturing parentheses.
+
+        * fast/regex/parentheses-expected.txt:
+        * fast/regex/script-tests/parentheses.js:
+
 2011-01-18  David Hyatt  <hyatt at apple.com>
 
         Reviewed by Dan Bernstein.
diff --git a/LayoutTests/fast/regex/parentheses-expected.txt b/LayoutTests/fast/regex/parentheses-expected.txt
index 6ec0df4..d526b10 100644
--- a/LayoutTests/fast/regex/parentheses-expected.txt
+++ b/LayoutTests/fast/regex/parentheses-expected.txt
@@ -67,6 +67,10 @@ PASS regexp40.exec('zPz') is ['',undefined,undefined,undefined,'']
 PASS regexp40.exec('zPPz') is ['',undefined,undefined,undefined,'']
 PASS regexp40.exec('zPPPz') is ['',undefined,undefined,undefined,'']
 PASS regexp40.exec('zPPPPz') is ['',undefined,undefined,undefined,'']
+PASS regexp41.exec('Here is a link: http://www.acme.com/our_products/index.html. That is all we want!') is ['http://www.acme.com/our_products/index.html','http://www.acme.com/our_products/index.html','http://','l',undefined]
+PASS regexp42.exec('') is ['',undefined,undefined]
+PASS regexp42.exec('4') is ['4','4','4']
+PASS regexp42.exec('4321') is ['4','4','4']
 PASS /(?!(?=r{0}){2,})|((z)?)?/gi.test('') is true
 PASS 'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/) is ['Bob',undefined,'Bob',undefined,undefined]
 PASS successfullyParsed is true
diff --git a/LayoutTests/fast/regex/script-tests/parentheses.js b/LayoutTests/fast/regex/script-tests/parentheses.js
index 3b98b49..db4bf13 100644
--- a/LayoutTests/fast/regex/script-tests/parentheses.js
+++ b/LayoutTests/fast/regex/script-tests/parentheses.js
@@ -183,6 +183,14 @@ shouldBe("regexp40.exec('zPPz')", "['',undefined,undefined,undefined,'']");
 shouldBe("regexp40.exec('zPPPz')", "['',undefined,undefined,undefined,'']");
 shouldBe("regexp40.exec('zPPPPz')", "['',undefined,undefined,undefined,'']");
 
+var regexp41 = /(([\w\-]+:\/\/?|www[.])[^\s()<>]+(?:([\w\d]+)|([^\[:punct:\]\s()<>\W]|\/)))/;
+shouldBe("regexp41.exec('Here is a link: http://www.acme.com/our_products/index.html. That is all we want!')", "['http://www.acme.com/our_products/index.html','http://www.acme.com/our_products/index.html','http://','l',undefined]");
+
+var regexp42 = /((?:(4)?))?/;
+shouldBe("regexp42.exec('')", "['',undefined,undefined]");
+shouldBe("regexp42.exec('4')", "['4','4','4']");
+shouldBe("regexp42.exec('4321')", "['4','4','4']");
+
 shouldBeTrue("/(?!(?=r{0}){2,})|((z)?)?/gi.test('')");
 
 shouldBe("'Hi Bob'.match(/(Rob)|(Bob)|(Robert)|(Bobby)/)", "['Bob',undefined,'Bob',undefined,undefined]");
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 3e53e96..e95b1b2 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-18  Michael Saboff  <msaboff at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        <rdar://problem/8875432> Regression: Some text-only e-mails cause hang beneath RegExp::match (52540)
+        https://bugs.webkit.org/show_bug.cgi?id=52540
+        https://bugs.webkit.org/show_bug.cgi?id=52662
+
+        Directly use backtrack label with parentheses nested under a
+        non-capturing parentheses.  Also linked current parentheses
+        tail code object for possible parens nested within a non-capturing
+        parentheses.
+
+        * yarr/YarrJIT.cpp:
+        (JSC::Yarr::YarrGenerator::BacktrackDestination::linkBacktrackToLabel):
+        (JSC::Yarr::YarrGenerator::generateParenthesesSingle):
+
 2011-01-18  Daniel Bates  <dbates at rim.com>
 
         Reviewed by Gavin Barraclough.
diff --git a/Source/JavaScriptCore/yarr/YarrJIT.cpp b/Source/JavaScriptCore/yarr/YarrJIT.cpp
index ae59cba..491d46d 100644
--- a/Source/JavaScriptCore/yarr/YarrJIT.cpp
+++ b/Source/JavaScriptCore/yarr/YarrJIT.cpp
@@ -748,6 +748,12 @@ class YarrGenerator : private MacroAssembler {
             return false;
         }
 
+        void linkBacktrackToLabel(Label backtrackLabel)
+        {
+            if (m_backtrackToLabel)
+                *m_backtrackToLabel = backtrackLabel;
+        }
+
         void linkAlternativeBacktracks(YarrGenerator* generator, bool nextIteration = false)
         {
             Label hereLabel = generator->label();
@@ -1007,7 +1013,6 @@ class YarrGenerator : private MacroAssembler {
         BacktrackDestination m_backtrack;
         BacktrackDestination* m_linkedBacktrack;
         ParenthesesTail* m_parenthesesTail;
-
     };
 
     struct ParenthesesTail {
@@ -1638,13 +1643,24 @@ class YarrGenerator : private MacroAssembler {
             m_expressionState.incrementParenNestingLevel();
 
             TermGenerationState parenthesesState(disjunction, state.checkedTotal);
+            
+            // Use the current paren Tail to connect the nested parentheses.
+            parenthesesState.setParenthesesTail(state.getParenthesesTail());
+
             generateParenthesesDisjunction(state.term(), parenthesesState, alternativeFrameLocation);
             // this expects that any backtracks back out of the parentheses will be in the
             // parenthesesState's m_backTrackJumps vector, and that if they need backtracking
             // they will have set an entry point on the parenthesesState's m_backtrackLabel.
             BacktrackDestination& parenthesesBacktrack = parenthesesState.getBacktrackDestination();
-            state.propagateBacktrackingFrom(this, parenthesesBacktrack);
-            state.getBacktrackDestination().copyBacktrackToLabel(parenthesesBacktrack);
+            BacktrackDestination& stateBacktrack = state.getBacktrackDestination();
+
+            // If we have a backtrack label, use it for the parenthesis
+            if (stateBacktrack.isLabel())
+                parenthesesBacktrack.linkBacktrackToLabel(stateBacktrack.getLabel());
+            else {
+                state.propagateBacktrackingFrom(this, parenthesesBacktrack);
+                stateBacktrack.copyBacktrackToLabel(parenthesesBacktrack);
+            }
 
             m_expressionState.decrementParenNestingLevel();
         } else {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list