@@ -73,11 +73,7 @@ Regex::Regex(const std::string& pattern_, bool ignoreCase)
7373 PCRE2_SIZE erroroffset = 0 ;
7474 m_pc = pcre2_compile (pcre2_pattern, PCRE2_ZERO_TERMINATED,
7575 pcre2_options, &errornumber, &erroroffset, NULL );
76-
7776 m_pcje = pcre2_jit_compile (m_pc, PCRE2_JIT_COMPLETE);
78- m_pmc = pcre2_match_context_create (NULL );
79- m_pcjs = pcre2_jit_stack_create (32 *1024 , 512 *1024 , NULL );
80- pcre2_jit_stack_assign (m_pmc, NULL , m_pcjs);
8177#else
8278 const char *errptr = NULL ;
8379 int erroffset;
@@ -97,8 +93,6 @@ Regex::Regex(const std::string& pattern_, bool ignoreCase)
9793Regex::~Regex () {
9894#if WITH_PCRE2
9995 pcre2_code_free (m_pc);
100- pcre2_match_context_free (m_pmc);
101- pcre2_jit_stack_free (m_pcjs);
10296#else
10397 if (m_pc != NULL ) {
10498 pcre_free (m_pc);
@@ -127,10 +121,10 @@ std::list<SMatch> Regex::searchAll(const std::string& s) const {
127121 do {
128122 if (m_pcje == 0 ) {
129123 rc = pcre2_jit_match (m_pc, pcre2_s, s.length (),
130- offset, 0 , match_data, m_pmc );
124+ offset, 0 , match_data, NULL );
131125 } else {
132126 rc = pcre2_match (m_pc, pcre2_s, s.length (),
133- offset, 0 , match_data, m_pmc );
127+ offset, 0 , match_data, NULL );
134128 }
135129 PCRE2_SIZE *ovector = pcre2_get_ovector_pointer (match_data);
136130#else
@@ -173,9 +167,9 @@ bool Regex::searchOneMatch(const std::string& s, std::vector<SMatchCapture>& cap
173167 pcre2_match_data *match_data = pcre2_match_data_create_from_pattern (m_pc, NULL );
174168 int rc;
175169 if (m_pcje == 0 ) {
176- rc = pcre2_jit_match (m_pc, pcre2_s, s.length (), 0 , 0 , match_data, m_pmc );
170+ rc = pcre2_jit_match (m_pc, pcre2_s, s.length (), 0 , 0 , match_data, NULL );
177171 } else {
178- rc = pcre2_match (m_pc, pcre2_s, s.length (), 0 , 0 , match_data, m_pmc );
172+ rc = pcre2_match (m_pc, pcre2_s, s.length (), 0 , 0 , match_data, NULL );
179173 }
180174 PCRE2_SIZE *ovector = pcre2_get_ovector_pointer (match_data);
181175#else
@@ -215,7 +209,7 @@ bool Regex::searchGlobal(const std::string& s, std::vector<SMatchCapture>& captu
215209 pcre2_options = PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED;
216210 }
217211 int rc = pcre2_match (m_pc, pcre2_s, s.length (),
218- startOffset, pcre2_options, match_data, m_pmc );
212+ startOffset, pcre2_options, match_data, NULL );
219213 PCRE2_SIZE *ovector = pcre2_get_ovector_pointer (match_data);
220214
221215#else
@@ -290,10 +284,10 @@ int Regex::search(const std::string& s, SMatch *match) const {
290284 int ret;
291285 if (m_pcje == 0 ) {
292286 ret = pcre2_match (m_pc, pcre2_s, s.length (),
293- 0 , 0 , match_data, m_pmc ) > 0 ;
287+ 0 , 0 , match_data, NULL ) > 0 ;
294288 } else {
295289 ret = pcre2_match (m_pc, pcre2_s, s.length (),
296- 0 , 0 , match_data, m_pmc ) > 0 ;
290+ 0 , 0 , match_data, NULL ) > 0 ;
297291 }
298292 if (ret > 0 ) { // match
299293 PCRE2_SIZE *ovector = pcre2_get_ovector_pointer (match_data);
@@ -321,9 +315,9 @@ int Regex::search(const std::string& s) const {
321315 pcre2_match_data *match_data = pcre2_match_data_create_from_pattern (m_pc, NULL );
322316 int rc;
323317 if (m_pcje == 0 ) {
324- rc = pcre2_jit_match (m_pc, pcre2_s, s.length (), 0 , 0 , match_data, m_pmc );
318+ rc = pcre2_jit_match (m_pc, pcre2_s, s.length (), 0 , 0 , match_data, NULL );
325319 } else {
326- rc = pcre2_match (m_pc, pcre2_s, s.length (), 0 , 0 , match_data, m_pmc );
320+ rc = pcre2_match (m_pc, pcre2_s, s.length (), 0 , 0 , match_data, NULL );
327321 }
328322 pcre2_match_data_free (match_data);
329323 if (rc > 0 ) {
0 commit comments