From 4804b00e8f50e446be43ee51863c8cdd3c743bea Mon Sep 17 00:00:00 2001
From: Philip Hazel <Philip.Hazel@gmail.com>
Date: Thu, 30 Jun 2022 17:37:51 +0100
Subject: [PATCH] Add an #ifdef to avoid the need even to link with
 pcre2_jit_compile.o when JIT is not supported

Conflict:delete changelog
Reference:https://github.com/PCRE2Project/pcre2/commit/4804b00e8f50e446be43ee51863c8cdd3c743bea
---
 src/pcre2_compile.c | 2 ++
 src/pcre2test.c     | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c
index 383159b..b906dc0 100644
--- a/src/pcre2_compile.c
+++ b/src/pcre2_compile.c
@@ -1264,8 +1264,10 @@ PCRE2_SIZE* ref_count;
 
 if (code != NULL)
   {
+#ifdef SUPPORT_JIT   
   if (code->executable_jit != NULL)
     PRIV(jit_free)(code->executable_jit, &code->memctl);
+#endif
 
   if ((code->flags & PCRE2_DEREF_TABLES) != 0)
     {
diff --git a/src/pcre2test.c b/src/pcre2test.c
index 84987d7..11ec3ca 100644
--- a/src/pcre2test.c
+++ b/src/pcre2test.c
@@ -4737,19 +4737,19 @@ if ((pat_patctl.control & CTL_INFO) != 0)
 
   if (pat_patctl.jit != 0 && (pat_patctl.control & CTL_JITVERIFY) != 0)
     {
+#ifdef SUPPORT_JIT
     if (FLD(compiled_code, executable_jit) != NULL)
       fprintf(outfile, "JIT compilation was successful\n");
     else
       {
-#ifdef SUPPORT_JIT
       fprintf(outfile, "JIT compilation was not successful");
       if (jitrc != 0 && !print_error_message(jitrc, " (", ")"))
         return PR_ABEND;
       fprintf(outfile, "\n");
+      }
 #else
       fprintf(outfile, "JIT support is not available in this version of PCRE2\n");
 #endif
-      }
     }
   }
 
-- 
2.27.0

