@@ -73,11 +73,7 @@ Regex::Regex(const std::string& pattern_, bool ignoreCase)
73
73
PCRE2_SIZE erroroffset = 0 ;
74
74
m_pc = pcre2_compile (pcre2_pattern, PCRE2_ZERO_TERMINATED,
75
75
pcre2_options, &errornumber, &erroroffset, NULL );
76
-
77
76
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);
81
77
#else
82
78
const char *errptr = NULL ;
83
79
int erroffset;
@@ -97,8 +93,6 @@ Regex::Regex(const std::string& pattern_, bool ignoreCase)
97
93
Regex::~Regex () {
98
94
#if WITH_PCRE2
99
95
pcre2_code_free (m_pc);
100
- pcre2_match_context_free (m_pmc);
101
- pcre2_jit_stack_free (m_pcjs);
102
96
#else
103
97
if (m_pc != NULL ) {
104
98
pcre_free (m_pc);
@@ -127,10 +121,10 @@ std::list<SMatch> Regex::searchAll(const std::string& s) const {
127
121
do {
128
122
if (m_pcje == 0 ) {
129
123
rc = pcre2_jit_match (m_pc, pcre2_s, s.length (),
130
- offset, 0 , match_data, m_pmc );
124
+ offset, 0 , match_data, NULL );
131
125
} else {
132
126
rc = pcre2_match (m_pc, pcre2_s, s.length (),
133
- offset, 0 , match_data, m_pmc );
127
+ offset, 0 , match_data, NULL );
134
128
}
135
129
PCRE2_SIZE *ovector = pcre2_get_ovector_pointer (match_data);
136
130
#else
@@ -173,9 +167,9 @@ bool Regex::searchOneMatch(const std::string& s, std::vector<SMatchCapture>& cap
173
167
pcre2_match_data *match_data = pcre2_match_data_create_from_pattern (m_pc, NULL );
174
168
int rc;
175
169
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 );
177
171
} 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 );
179
173
}
180
174
PCRE2_SIZE *ovector = pcre2_get_ovector_pointer (match_data);
181
175
#else
@@ -215,7 +209,7 @@ bool Regex::searchGlobal(const std::string& s, std::vector<SMatchCapture>& captu
215
209
pcre2_options = PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED;
216
210
}
217
211
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 );
219
213
PCRE2_SIZE *ovector = pcre2_get_ovector_pointer (match_data);
220
214
221
215
#else
@@ -290,10 +284,10 @@ int Regex::search(const std::string& s, SMatch *match) const {
290
284
int ret;
291
285
if (m_pcje == 0 ) {
292
286
ret = pcre2_match (m_pc, pcre2_s, s.length (),
293
- 0 , 0 , match_data, m_pmc ) > 0 ;
287
+ 0 , 0 , match_data, NULL ) > 0 ;
294
288
} else {
295
289
ret = pcre2_match (m_pc, pcre2_s, s.length (),
296
- 0 , 0 , match_data, m_pmc ) > 0 ;
290
+ 0 , 0 , match_data, NULL ) > 0 ;
297
291
}
298
292
if (ret > 0 ) { // match
299
293
PCRE2_SIZE *ovector = pcre2_get_ovector_pointer (match_data);
@@ -321,9 +315,9 @@ int Regex::search(const std::string& s) const {
321
315
pcre2_match_data *match_data = pcre2_match_data_create_from_pattern (m_pc, NULL );
322
316
int rc;
323
317
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 );
325
319
} 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 );
327
321
}
328
322
pcre2_match_data_free (match_data);
329
323
if (rc > 0 ) {
0 commit comments