|
|
b2aafa |
From c061f6a865a473cf93aae1e6a0ccd2325509a6b2 Mon Sep 17 00:00:00 2001
|
|
|
b2aafa |
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
|
|
|
b2aafa |
Date: Thu, 9 Jan 2014 13:39:28 +0100
|
|
|
b2aafa |
Subject: [PATCH] Fix range check in JIT path
|
|
|
b2aafa |
MIME-Version: 1.0
|
|
|
b2aafa |
Content-Type: text/plain; charset=UTF-8
|
|
|
b2aafa |
Content-Transfer-Encoding: 8bit
|
|
|
b2aafa |
|
|
|
b2aafa |
Jitted range check was wrong:
|
|
|
b2aafa |
|
|
|
b2aafa |
re> /[efij]/S+
|
|
|
b2aafa |
data> e
|
|
|
b2aafa |
No match
|
|
|
b2aafa |
|
|
|
b2aafa |
while interpretted path is correct:
|
|
|
b2aafa |
|
|
|
b2aafa |
re> /[efij]/
|
|
|
b2aafa |
data> e
|
|
|
b2aafa |
0: e
|
|
|
b2aafa |
|
|
|
b2aafa |
This fix is part of:
|
|
|
b2aafa |
|
|
|
b2aafa |
commit c07887b22a83fba842e88889c9e57a622b9ee439
|
|
|
b2aafa |
Author: zherczeg <zherczeg@2f5784b3-3f2a-0410-8824-cb99058d5e15>
|
|
|
b2aafa |
Date: Sun Dec 22 20:47:08 2013 +0000
|
|
|
b2aafa |
|
|
|
b2aafa |
The auto-possessification of character sets were improved. The JIT compiler also optimizes more character set checks.
|
|
|
b2aafa |
|
|
|
b2aafa |
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1415 2f5784b3-3f2a-0410-8824-cb99058d5e15
|
|
|
b2aafa |
|
|
|
b2aafa |
<http://bugs.exim.org/show_bug.cgi?id=1423>
|
|
|
b2aafa |
|
|
|
b2aafa |
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
|
|
b2aafa |
---
|
|
|
b2aafa |
pcre_jit_compile.c | 4 +++-
|
|
|
b2aafa |
1 file changed, 3 insertions(+), 1 deletion(-)
|
|
|
b2aafa |
|
|
|
b2aafa |
diff --git a/pcre_jit_compile.c b/pcre_jit_compile.c
|
|
|
b2aafa |
index d070263..47447da 100644
|
|
|
b2aafa |
--- a/pcre_jit_compile.c
|
|
|
b2aafa |
+++ b/pcre_jit_compile.c
|
|
|
b2aafa |
@@ -3573,7 +3573,9 @@ switch(ranges[0])
|
|
|
b2aafa |
}
|
|
|
b2aafa |
return TRUE;
|
|
|
b2aafa |
}
|
|
|
b2aafa |
- if ((ranges[3] - ranges[2]) == (ranges[5] - ranges[4]) && is_powerof2(ranges[4] - ranges[2]))
|
|
|
b2aafa |
+ if ((ranges[3] - ranges[2]) == (ranges[5] - ranges[4])
|
|
|
b2aafa |
+ && (ranges[2] | (ranges[4] - ranges[2])) == ranges[4]
|
|
|
b2aafa |
+ && is_powerof2(ranges[4] - ranges[2]))
|
|
|
b2aafa |
{
|
|
|
b2aafa |
if (readch)
|
|
|
b2aafa |
read_char(common);
|
|
|
b2aafa |
--
|
|
|
b2aafa |
1.8.3.1
|
|
|
b2aafa |
|