From d07c967b3ac93a9bd8816837053a75b0f8a816c9 Mon Sep 17 00:00:00 2001
From: Zoltan Herczeg <hzmester@freemail.hu>
Date: Thu, 14 Apr 2022 19:09:40 +0000
Subject: [PATCH] Fix recursion issue in JIT

Conflict:NA
Reference:https://github.com/PhilipHazel/pcre2/commit/d07c967b3ac93a9bd8816837053a75b0f8a816c9
---
 src/pcre2_jit_compile.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index e47a9f3..b98bf95 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -2909,14 +2909,15 @@ while (cc < ccend)
     i = 1 + 32 / (int)sizeof(PCRE2_UCHAR);
 #endif
     if (PRIVATE_DATA(cc) != 0)
+      {
+      private_count = 1;
+      private_srcw[0] = PRIVATE_DATA(cc);
       switch(get_class_iterator_size(cc + i))
         {
         case 1:
-        private_srcw[0] = PRIVATE_DATA(cc);
         break;
 
         case 2:
-        private_srcw[0] = PRIVATE_DATA(cc);
         if (recurse_check_bit(common, private_srcw[0]))
           {
           private_count = 2;
@@ -2929,6 +2930,7 @@ while (cc < ccend)
         SLJIT_UNREACHABLE();
         break;
         }
+      }
     cc += i;
     break;
 
-- 
2.27.0

