Add an #ifdef to avoid the need even to link with pcre2_jit_compile.o when JIT is not supported

This commit is contained in:
Philip Hazel 2022-06-30 17:37:51 +01:00
parent 7549fdca74
commit 4804b00e8f
3 changed files with 9 additions and 2 deletions

View File

@ -24,6 +24,11 @@ pcre2test.
6. Change a number of int variables that hold buffer and line lengths in 6. Change a number of int variables that hold buffer and line lengths in
pcre2grep to PCRE2_SIZE (aka size_t). pcre2grep to PCRE2_SIZE (aka size_t).
7. Added an #ifdef to cut out a call to PRIV(jit_free) when JIT is not
supported (even though that function would do nothing in that case) at the
request of a user who doesn't even want to link with pcre_jit_compile.o. Also
tidied up an untidy #ifdef arrangement in pcre2test.
Version 10.40 15-April-2022 Version 10.40 15-April-2022
--------------------------- ---------------------------

View File

@ -1266,8 +1266,10 @@ PCRE2_SIZE* ref_count;
if (code != NULL) if (code != NULL)
{ {
#ifdef SUPPORT_JIT
if (code->executable_jit != NULL) if (code->executable_jit != NULL)
PRIV(jit_free)(code->executable_jit, &code->memctl); PRIV(jit_free)(code->executable_jit, &code->memctl);
#endif
if ((code->flags & PCRE2_DEREF_TABLES) != 0) if ((code->flags & PCRE2_DEREF_TABLES) != 0)
{ {

View File

@ -4755,21 +4755,21 @@ if ((pat_patctl.control & CTL_INFO) != 0)
if (pat_patctl.jit != 0 && (pat_patctl.control & CTL_JITVERIFY) != 0) if (pat_patctl.jit != 0 && (pat_patctl.control & CTL_JITVERIFY) != 0)
{ {
#ifdef SUPPORT_JIT
if (FLD(compiled_code, executable_jit) != NULL) if (FLD(compiled_code, executable_jit) != NULL)
fprintf(outfile, "JIT compilation was successful\n"); fprintf(outfile, "JIT compilation was successful\n");
else else
{ {
#ifdef SUPPORT_JIT
fprintf(outfile, "JIT compilation was not successful"); fprintf(outfile, "JIT compilation was not successful");
if (jitrc != 0 && !print_error_message(jitrc, " (", ")")) if (jitrc != 0 && !print_error_message(jitrc, " (", ")"))
return PR_ABEND; return PR_ABEND;
fprintf(outfile, "\n"); fprintf(outfile, "\n");
}
#else #else
fprintf(outfile, "JIT support is not available in this version of PCRE2\n"); fprintf(outfile, "JIT support is not available in this version of PCRE2\n");
#endif #endif
} }
} }
}
if ((pat_patctl.control & CTL_CALLOUT_INFO) != 0) if ((pat_patctl.control & CTL_CALLOUT_INFO) != 0)
{ {