Revision: 565
http://www.exim.org/viewvc/pcre2?view=rev&revision=565
Author: ph10
Date: 2016-10-13 18:20:08 +0100 (Thu, 13 Oct 2016)
Log Message:
-----------
Make pcre2grep work (using the interpreter) if compiled with JIT support when
the main library does not have it.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/NON-AUTOTOOLS-BUILD
code/trunk/src/pcre2grep.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2016-10-13 16:08:08 UTC (rev 564)
+++ code/trunk/ChangeLog 2016-10-13 17:20:08 UTC (rev 565)
@@ -67,7 +67,12 @@
expansion when long lines are encountered. Original patch by Dmitry
Cherniachenko.
+11. If pcre2grep was compiled with JIT support, but the library was compiled
+without it (something that neither ./configure nor CMake allow, but it can be
+done by editing config.h), pcre2grep was giving a JIT error. Now it detects
+this situation and does not try to use JIT.
+
Version 10.22 29-July-2016
--------------------------
Modified: code/trunk/NON-AUTOTOOLS-BUILD
===================================================================
--- code/trunk/NON-AUTOTOOLS-BUILD 2016-10-13 16:08:08 UTC (rev 564)
+++ code/trunk/NON-AUTOTOOLS-BUILD 2016-10-13 17:20:08 UTC (rev 565)
@@ -174,7 +174,11 @@
(11) If you want to use the pcre2grep command, compile and link
src/pcre2grep.c; it uses only the basic 8-bit PCRE2 library (it does not
- need the pcre2posix library).
+ need the pcre2posix library). If you have built the PCRE2 library with JIT
+ support by defining SUPPORT_JIT in src/config.h, you can also define
+ SUPPORT_PCRE2GREP_JIT, which causes pcre2grep to make use of JIT (unless
+ it is run with --no-jit). If you define SUPPORT_PCRE2GREP_JIT without
+ defining SUPPORT_JIT, pcre2grep does not try to make use of JIT.
STACK SIZE IN WINDOWS ENVIRONMENTS
@@ -389,4 +393,4 @@
recommended download site.
=============================
-Last Updated: 16 July 2015
+Last Updated: 13 October 2016
Modified: code/trunk/src/pcre2grep.c
===================================================================
--- code/trunk/src/pcre2grep.c 2016-10-13 16:08:08 UTC (rev 564)
+++ code/trunk/src/pcre2grep.c 2016-10-13 17:20:08 UTC (rev 565)
@@ -3460,6 +3460,16 @@
}
#endif
+/* If use_jit is set, check whether JIT is available. If not, do not try
+to use JIT. */
+
+if (use_jit)
+ {
+ uint32_t answer;
+ (void)pcre2_config(PCRE2_CONFIG_JIT, &answer);
+ if (!answer) use_jit = FALSE;
+ }
+
/* Get memory for the main buffer. */
if (bufthird <= 0)