Revision: 1596
http://vcs.pcre.org/viewvc?view=rev&revision=1596
Author: zherczeg
Date: 2015-08-26 14:44:24 +0100 (Wed, 26 Aug 2015)
Log Message:
-----------
Fixed a corner case of range optimization in JIT.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/pcre_jit_compile.c
code/trunk/pcre_jit_test.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2015-08-24 09:49:06 UTC (rev 1595)
+++ code/trunk/ChangeLog 2015-08-26 13:44:24 UTC (rev 1596)
@@ -143,7 +143,9 @@
37. Fix two assertion fails in JIT. These issues were found by Karl Skomski
with a custom LLVM fuzzer.
+38. Fixed a corner case of range optimization in JIT.
+
Version 8.37 28-April-2015
--------------------------
Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c 2015-08-24 09:49:06 UTC (rev 1595)
+++ code/trunk/pcre_jit_compile.c 2015-08-26 13:44:24 UTC (rev 1596)
@@ -4342,8 +4342,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/pcre_jit_test.c
===================================================================
--- code/trunk/pcre_jit_test.c 2015-08-24 09:49:06 UTC (rev 1595)
+++ code/trunk/pcre_jit_test.c 2015-08-26 13:44:24 UTC (rev 1596)
@@ -182,6 +182,7 @@
{ CMUAP, 0, "\xf0\x90\x90\x80{2}", "\xf0\x90\x90\x80#\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
{ CMUAP, 0, "\xf0\x90\x90\xa8{2}", "\xf0\x90\x90\x80#\xf0\x90\x90\xa8\xf0\x90\x90\x80" },
{ CMUAP, 0, "\xe1\xbd\xb8\xe1\xbf\xb8", "\xe1\xbf\xb8\xe1\xbd\xb8" },
+ { MA, 0, "[3-57-9]", "5" },
/* Assertions. */
{ MUA, 0, "\\b[^A]", "A_B#" },