Title: [225771] trunk/Source/_javascript_Core
Revision
225771
Author
msab...@apple.com
Date
2017-12-11 21:47:18 -0800 (Mon, 11 Dec 2017)

Log Message

REGRESSION(r225683): Chakra test failure in es6/regex-unicode.js for 32bit builds
https://bugs.webkit.org/show_bug.cgi?id=180685

Reviewed by Saam Barati.

The characterClass->m_anyCharacter check at the top of checkCharacterClass() caused
the character class check to return true without reading the character.  Given that
the character could be a surrogate pair, we need to read the character even if we
don't have the check it.

* yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::testCharacterClass):
(JSC::Yarr::Interpreter::checkCharacterClass):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (225770 => 225771)


--- trunk/Source/_javascript_Core/ChangeLog	2017-12-12 04:54:24 UTC (rev 225770)
+++ trunk/Source/_javascript_Core/ChangeLog	2017-12-12 05:47:18 UTC (rev 225771)
@@ -1,3 +1,19 @@
+2017-12-11  Michael Saboff  <msab...@apple.com>
+
+        REGRESSION(r225683): Chakra test failure in es6/regex-unicode.js for 32bit builds
+        https://bugs.webkit.org/show_bug.cgi?id=180685
+
+        Reviewed by Saam Barati.
+
+        The characterClass->m_anyCharacter check at the top of checkCharacterClass() caused
+        the character class check to return true without reading the character.  Given that
+        the character could be a surrogate pair, we need to read the character even if we
+        don't have the check it.
+
+        * yarr/YarrInterpreter.cpp:
+        (JSC::Yarr::Interpreter::testCharacterClass):
+        (JSC::Yarr::Interpreter::checkCharacterClass):
+
 2017-12-11  Saam Barati  <sbar...@apple.com>
 
         We need to disableCaching() in ErrorInstance when we materialize properties

Modified: trunk/Source/_javascript_Core/yarr/YarrInterpreter.cpp (225770 => 225771)


--- trunk/Source/_javascript_Core/yarr/YarrInterpreter.cpp	2017-12-12 04:54:24 UTC (rev 225770)
+++ trunk/Source/_javascript_Core/yarr/YarrInterpreter.cpp	2017-12-12 05:47:18 UTC (rev 225771)
@@ -352,6 +352,9 @@
             return false;
         };
 
+        if (characterClass->m_anyCharacter)
+            return true;
+
         const size_t thresholdForBinarySearch = 6;
 
         if (!isASCII(ch)) {
@@ -409,9 +412,6 @@
 
     bool checkCharacterClass(CharacterClass* characterClass, bool invert, unsigned negativeInputOffset)
     {
-        if (characterClass->m_anyCharacter)
-            return !invert;
-
         bool match = testCharacterClass(characterClass, input.readChecked(negativeInputOffset));
         return invert ? !match : match;
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to