Make pcre2grep work (using the interpreter) if compiled with JIT support when

the main library does not have it.
This commit is contained in:
Philip.Hazel 2016-10-13 17:20:08 +00:00
parent bc3e331efd
commit b3afb24224
3 changed files with 21 additions and 2 deletions

View File

@ -67,6 +67,11 @@ PCRE2_STATIC_RUNTIME). Fix from David Gaussmann.
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
--------------------------

View File

@ -174,7 +174,11 @@ can skip ahead to the CMake section.
(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 @@ and executable, is in EBCDIC and native z/OS file formats and this is the
recommended download site.
=============================
Last Updated: 16 July 2015
Last Updated: 13 October 2016

View File

@ -3460,6 +3460,16 @@ if (jfriedl_XT != 0 || jfriedl_XR != 0)
}
#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)