[Pcre-svn] [356] code/trunk: Fixed a corner case of range op…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [356] code/trunk: Fixed a corner case of range optimization in JIT.
Revision: 356
          http://www.exim.org/viewvc/pcre2?view=rev&revision=356
Author:   zherczeg
Date:     2015-08-26 14:35:58 +0100 (Wed, 26 Aug 2015)
Log Message:
-----------
Fixed a corner case of range optimization in JIT.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/src/pcre2_jit_compile.c
    code/trunk/src/pcre2_jit_test.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2015-08-24 16:31:30 UTC (rev 355)
+++ code/trunk/ChangeLog    2015-08-26 13:35:58 UTC (rev 356)
@@ -160,7 +160,9 @@
 44. Fix bug in RunTest.bat for new test 14, and adjust the script for the added 
 test (there are now 20 in total).


+45. Fixed a corner case of range optimization in JIT.

+
Version 10.20 30-June-2015
--------------------------


Modified: code/trunk/src/pcre2_jit_compile.c
===================================================================
--- code/trunk/src/pcre2_jit_compile.c    2015-08-24 16:31:30 UTC (rev 355)
+++ code/trunk/src/pcre2_jit_compile.c    2015-08-26 13:35:58 UTC (rev 356)
@@ -4997,8 +4997,10 @@
   case 4:
   if ((ranges[1] - ranges[0]) == (ranges[3] - ranges[2])
       && (ranges[0] | (ranges[2] - ranges[0])) == ranges[2]
+      && (ranges[1] & (ranges[2] - ranges[0])) == 0
       && is_powerof2(ranges[2] - ranges[0]))
     {
+    SLJIT_ASSERT((ranges[0] & (ranges[2] - ranges[0])) == 0 && (ranges[2] & ranges[3] & (ranges[2] - ranges[0])) != 0);
     OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, ranges[2] - ranges[0]);
     if (ranges[2] + 1 != ranges[3])
       {


Modified: code/trunk/src/pcre2_jit_test.c
===================================================================
--- code/trunk/src/pcre2_jit_test.c    2015-08-24 16:31:30 UTC (rev 355)
+++ code/trunk/src/pcre2_jit_test.c    2015-08-26 13:35:58 UTC (rev 356)
@@ -188,6 +188,7 @@
     { CMUP, A, 0, 0, "\xf0\x90\x90\x80{2}", "\xf0\x90\x90\x80#\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
     { CMUP, A, 0, 0, "\xf0\x90\x90\xa8{2}", "\xf0\x90\x90\x80#\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
     { CMUP, A, 0, 0, "\xe1\xbd\xb8\xe1\xbf\xb8", "\xe1\xbf\xb8\xe1\xbd\xb8" },
+    { M, A, 0, 0, "[3-57-9]", "5" },


     /* Assertions. */
     { MU, A, 0, 0, "\\b[^A]", "A_B#" },