2009-05-26 Gavin Barraclough <barraclough@apple.com>
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 May 2009 00:33:13 +0000 (00:33 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 May 2009 00:33:13 +0000 (00:33 +0000)
        Reviewed by Oliver "pieces of eight" Hunt.

        When reseting RegexPattern class, should fully reset the class, not just bits of it.
        In particular, we delete the cached character classes (for wordchars, etc), but do
        not reset the set of pointers to the cached classes.  In the case of a repeated parse
        due to an illegal back-reference we will continue to use the deleted character class.

        * yarr/RegexPattern.h:
        (JSC::Yarr::RegexPattern::reset):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@44169 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/yarr/RegexPattern.h

index 5489b65..a09ed6f 100644 (file)
@@ -1,3 +1,15 @@
+2009-05-26  Gavin Barraclough  <barraclough@apple.com>
+
+        Reviewed by Oliver "pieces of eight" Hunt.
+
+        When reseting RegexPattern class, should fully reset the class, not just bits of it.
+        In particular, we delete the cached character classes (for wordchars, etc), but do
+        not reset the set of pointers to the cached classes.  In the case of a repeated parse
+        due to an illegal back-reference we will continue to use the deleted character class.
+
+        * yarr/RegexPattern.h:
+        (JSC::Yarr::RegexPattern::reset):
+
 2009-05-26  Brent Fulgham  <bfulgham@webkit.org>
 
         Build fix to correct r44161.
index 939d36f..2e821a9 100644 (file)
@@ -263,6 +263,14 @@ struct RegexPattern {
         m_numSubpatterns = 0;
         m_maxBackReference = 0;
 
+        newlineCached = 0;
+        digitsCached = 0;
+        spacesCached = 0;
+        wordcharCached = 0;
+        nondigitsCached = 0;
+        nonspacesCached = 0;
+        nonwordcharCached = 0;
+
         deleteAllValues(m_disjunctions);
         m_disjunctions.clear();
         deleteAllValues(m_userCharacterClasses);