[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

barraclough at apple.com barraclough at apple.com
Wed Dec 22 17:52:12 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 59f55737ab5045991a1db73dc6462a98c7cf9d79
Author: barraclough at apple.com <barraclough at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 1 21:53:59 2010 +0000

    JavaScriptCore: 010-12-01  Steve Falkenburg  <sfalken at apple.com>
    
    Reviewed by Adam Roben.
    
    vcproj changes can't be applied cleanly by the Windows EWS bot
    https://bugs.webkit.org/show_bug.cgi?id=50328
    
    * JavaScriptCore.vcproj/JavaScriptCore.sln: Modified property svn:eol-style.
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: Modified property svn:eol-style.
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCF.vsprops: Added property svn:eol-style.
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCFLite.vsprops: Added property svn:eol-style.
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops: Added property svn:eol-style.
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.vcproj: Modified property svn:eol-style.
    * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGeneratedCommon.vsprops: Added property svn:eol-style.
    * JavaScriptCore.vcproj/JavaScriptCoreSubmit.sln: Modified property svn:eol-style.
    * JavaScriptCore.vcproj/WTF/WTF.vcproj: Modified property svn:eol-style.
    * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops: Added property svn:eol-style.
    * JavaScriptCore.vcproj/jsc/jsc.vcproj: Modified property svn:eol-style.
    * JavaScriptCore.vcproj/jsc/jscCommon.vsprops: Added property svn:eol-style.
    * JavaScriptCore.vcproj/testapi/testapi.vcproj: Modified property svn:eol-style.
    * JavaScriptCore.vcproj/testapi/testapiCommon.vsprops: Added property svn:eol-style.
    
    LayoutTests: Bug 50298 - /()()()()()()()()()(?:(\10a|b)(X|Y))+/.exec("bXXaYYaY") ASSERTs
    
    Reviewed by Sam Weinig.
    
    * fast/regex/script-tests/pcre-test-1.js:
        Enable regex643, this now works.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73065 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 00c347e..0bd4fb0 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -22,11 +22,30 @@
 
 2010-12-01  Gavin Barraclough  <barraclough at apple.com>
 
-        Rubber stamped by Sam Weinig.
+        Reviewed by Sam Weinig.
 
-        Bug 50297 - \s in YARR should match BOMs.
+        Bug 50298 - /()()()()()()()()()(?:(\10a|b)(X|Y))+/.exec("bXXaYYaY") ASSERTs
 
-        * create_regex_tables:
+        For unmatched subpattens we previously used to set the subpattern end to -1,
+        but now we only set the start value. E.g. consider the following:
+            /a(b)?c/.exec("ac");
+        Previously we would generate an internal results array of:
+            [ 0, 2, -1, -1 ]
+        Since fairly recently we have generated results of:
+            [ 0, 2, -1, ??? ]
+        (With the end index of the subpattern uninitialized).
+
+        Update these ASSERTs to account for this.
+
+        Also, when stripping out self-referencing backreferences, (e.g. /(\1)/) we
+        were checking the wrong property on the pattern term. We should have been
+        looking at term.parentheses.subpatternId, but instead were checking
+        term.subpatternId. The latter is actually only the subpatternId for
+        back reference terms. Rename this to backReferenceSubpatternId.
+
+        * yarr/RegexInterpreter.cpp:
+        (JSC::Yarr::Interpreter::matchBackReference):
+        (JSC::Yarr::Interpreter::backtrackBackReference):
 
 2010-11-30  Gavin Barraclough  <barraclough at apple.com>
 
diff --git a/JavaScriptCore/yarr/RegexCompiler.cpp b/JavaScriptCore/yarr/RegexCompiler.cpp
index a56b5b9..e40c791 100644
--- a/JavaScriptCore/yarr/RegexCompiler.cpp
+++ b/JavaScriptCore/yarr/RegexCompiler.cpp
@@ -520,7 +520,7 @@ public:
             PatternTerm& term = currentAlternative->lastTerm();
             ASSERT((term.type == PatternTerm::TypeParenthesesSubpattern) || (term.type == PatternTerm::TypeParentheticalAssertion));
 
-            if ((term.type == PatternTerm::TypeParenthesesSubpattern) && term.invertOrCapture && (subpatternId == term.subpatternId)) {
+            if ((term.type == PatternTerm::TypeParenthesesSubpattern) && term.invertOrCapture && (subpatternId == term.parentheses.subpatternId)) {
                 m_alternative->m_terms.append(PatternTerm::ForwardReference());
                 return;
             }
diff --git a/JavaScriptCore/yarr/RegexInterpreter.cpp b/JavaScriptCore/yarr/RegexInterpreter.cpp
index f362f6f..a51cd25 100644
--- a/JavaScriptCore/yarr/RegexInterpreter.cpp
+++ b/JavaScriptCore/yarr/RegexInterpreter.cpp
@@ -515,8 +515,7 @@ public:
         if (matchEnd == -1)
             return true;
 
-        ASSERT((matchBegin == -1) == (matchEnd == -1));
-        ASSERT(matchBegin <= matchEnd);
+        ASSERT((matchBegin == -1) || (matchBegin <= matchEnd));
 
         if (matchBegin == matchEnd)
             return true;
@@ -558,8 +557,7 @@ public:
 
         int matchBegin = output[(term.atom.subpatternId << 1)];
         int matchEnd = output[(term.atom.subpatternId << 1) + 1];
-        ASSERT((matchBegin == -1) == (matchEnd == -1));
-        ASSERT(matchBegin <= matchEnd);
+        ASSERT((matchBegin == -1) || (matchBegin <= matchEnd));
 
         if (matchBegin == matchEnd)
             return false;
@@ -1828,7 +1826,7 @@ public:
                     break;
 
                 case PatternTerm::TypeBackReference:
-                    atomBackReference(term.subpatternId, term.inputPosition - currentCountAlreadyChecked, term.frameLocation, term.quantityCount, term.quantityType);
+                    atomBackReference(term.backReferenceSubpatternId, term.inputPosition - currentCountAlreadyChecked, term.frameLocation, term.quantityCount, term.quantityType);
                         break;
 
                 case PatternTerm::TypeForwardReference:
diff --git a/JavaScriptCore/yarr/RegexPattern.h b/JavaScriptCore/yarr/RegexPattern.h
index c76c641..8a7d35b 100644
--- a/JavaScriptCore/yarr/RegexPattern.h
+++ b/JavaScriptCore/yarr/RegexPattern.h
@@ -107,7 +107,7 @@ struct PatternTerm {
     union {
         UChar patternCharacter;
         CharacterClass* characterClass;
-        unsigned subpatternId;
+        unsigned backReferenceSubpatternId;
         struct {
             PatternDisjunction* disjunction;
             unsigned subpatternId;
@@ -162,7 +162,7 @@ struct PatternTerm {
         : type(TypeBackReference)
         , invertOrCapture(false)
     {
-        subpatternId = spatternId;
+        backReferenceSubpatternId = spatternId;
         quantityType = QuantifierFixedCount;
         quantityCount = 1;
     }
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 97f5a26..6e20daa 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-12-01  Gavin Barraclough  <barraclough at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Bug 50298 - /()()()()()()()()()(?:(\10a|b)(X|Y))+/.exec("bXXaYYaY") ASSERTs
+
+        * fast/regex/script-tests/pcre-test-1.js:
+            Enable regex643, this now works.
+
 2010-12-01  Ojan Vafai  <ojan at chromium.org>
 
         [chromium] Green tree.
diff --git a/LayoutTests/fast/regex/pcre-test-1-expected.txt b/LayoutTests/fast/regex/pcre-test-1-expected.txt
index 8f51f33..c105f41 100644
--- a/LayoutTests/fast/regex/pcre-test-1-expected.txt
+++ b/LayoutTests/fast/regex/pcre-test-1-expected.txt
@@ -1270,6 +1270,7 @@ PASS regex637.exec(input1); is results
 PASS regex641.exec(input0); is results
 PASS regex642.exec(input0); is results
 PASS regex642.exec(input1); is results
+PASS regex643.exec(input0); is results
 PASS regex644.exec(input0); is results
 PASS regex644.exec(input1); is results
 PASS regex644.exec(input2); is results
diff --git a/LayoutTests/fast/regex/script-tests/pcre-test-1.js b/LayoutTests/fast/regex/script-tests/pcre-test-1.js
index 4e186fa..abd13dd 100644
--- a/LayoutTests/fast/regex/script-tests/pcre-test-1.js
+++ b/LayoutTests/fast/regex/script-tests/pcre-test-1.js
@@ -5112,12 +5112,10 @@ var input1 = "bXYaXXaX";
 var results = ["bX", "X"];
 shouldBe('regex642.exec(input1);', 'results');
 
-// FIXME: this regex trips an ASSERT in JSC.
-// https://bugs.webkit.org/show_bug.cgi?id=50298
-//var regex643 = /()()()()()()()()()(?:(\10a|b)(X|Y))+/;
-//var input0 = "bXXaYYaY";
-//var results = ["bX", "", "", "", "", "", "", "", "", "", "X"];
-//shouldBe('regex643.exec(input0);', 'results');
+var regex643 = /()()()()()()()()()(?:(\10a|b)(X|Y))+/;
+var input0 = "bXXaYYaY";
+var results = ["bX", "", "", "", "", "", "", "", "", "", "b", "X"];
+shouldBe('regex643.exec(input0);', 'results');
 
 var regex644 = /[[,abc,]+]/;
 var input0 = "abc]";

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list