Line | Source Code | Coverage |
---|
1 | /************************************************* | - |
2 | * Perl-Compatible Regular Expressions * | - |
3 | *************************************************/ | - |
4 | | - |
5 | /* PCRE is a library of functions to support regular expressions whose syntax | - |
6 | and semantics are as close as possible to those of the Perl 5 language. | - |
7 | | - |
8 | Written by Philip Hazel | - |
9 | Copyright (c) 1997-2012 University of Cambridge | - |
10 | | - |
11 | ----------------------------------------------------------------------------- | - |
12 | Redistribution and use in source and binary forms, with or without | - |
13 | modification, are permitted provided that the following conditions are met: | - |
14 | | - |
15 | * Redistributions of source code must retain the above copyright notice, | - |
16 | this list of conditions and the following disclaimer. | - |
17 | | - |
18 | * Redistributions in binary form must reproduce the above copyright | - |
19 | notice, this list of conditions and the following disclaimer in the | - |
20 | documentation and/or other materials provided with the distribution. | - |
21 | | - |
22 | * Neither the name of the University of Cambridge nor the names of its | - |
23 | contributors may be used to endorse or promote products derived from | - |
24 | this software without specific prior written permission. | - |
25 | | - |
26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | - |
27 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | - |
28 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | - |
29 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | - |
30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | - |
31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | - |
32 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | - |
33 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | - |
34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | - |
35 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | - |
36 | POSSIBILITY OF SUCH DAMAGE. | - |
37 | ----------------------------------------------------------------------------- | - |
38 | */ | - |
39 | | - |
40 | | - |
41 | /* This module contains pcre_exec(), the externally visible function that does | - |
42 | pattern matching using an NFA algorithm, trying to mimic Perl as closely as | - |
43 | possible. There are also some static supporting functions. */ | - |
44 | | - |
45 | #ifdef PCRE_HAVE_CONFIG_H | - |
46 | #include "config.h" | - |
47 | #endif | - |
48 | | - |
49 | #define NLBLOCK md /* Block containing newline information */ | - |
50 | #define PSSTART start_subject /* Field containing processed string start */ | - |
51 | #define PSEND end_subject /* Field containing processed string end */ | - |
52 | | - |
53 | #include "pcre_internal.h" | - |
54 | | - |
55 | /* Undefine some potentially clashing cpp symbols */ | - |
56 | | - |
57 | #undef min | - |
58 | #undef max | - |
59 | | - |
60 | /* Values for setting in md->match_function_type to indicate two special types | - |
61 | of call to match(). We do it this way to save on using another stack variable, | - |
62 | as stack usage is to be discouraged. */ | - |
63 | | - |
64 | #define MATCH_CONDASSERT 1 /* Called to check a condition assertion */ | - |
65 | #define MATCH_CBEGROUP 2 /* Could-be-empty unlimited repeat group */ | - |
66 | | - |
67 | /* Non-error returns from the match() function. Error returns are externally | - |
68 | defined PCRE_ERROR_xxx codes, which are all negative. */ | - |
69 | | - |
70 | #define MATCH_MATCH 1 | - |
71 | #define MATCH_NOMATCH 0 | - |
72 | | - |
73 | /* Special internal returns from the match() function. Make them sufficiently | - |
74 | negative to avoid the external error codes. */ | - |
75 | | - |
76 | #define MATCH_ACCEPT (-999) | - |
77 | #define MATCH_COMMIT (-998) | - |
78 | #define MATCH_KETRPOS (-997) | - |
79 | #define MATCH_ONCE (-996) | - |
80 | #define MATCH_PRUNE (-995) | - |
81 | #define MATCH_SKIP (-994) | - |
82 | #define MATCH_SKIP_ARG (-993) | - |
83 | #define MATCH_THEN (-992) | - |
84 | | - |
85 | /* Maximum number of ints of offset to save on the stack for recursive calls. | - |
86 | If the offset vector is bigger, malloc is used. This should be a multiple of 3, | - |
87 | because the offset vector is always a multiple of 3 long. */ | - |
88 | | - |
89 | #define REC_STACK_SAVE_MAX 30 | - |
90 | | - |
91 | /* Min and max values for the common repeats; for the maxima, 0 => infinity */ | - |
92 | | - |
93 | static const char rep_min[] = { 0, 0, 1, 1, 0, 0 }; | - |
94 | static const char rep_max[] = { 0, 0, 0, 0, 1, 1 }; | - |
95 | | - |
96 | | - |
97 | | - |
98 | #ifdef PCRE_DEBUG | - |
99 | /************************************************* | - |
100 | * Debugging function to print chars * | - |
101 | *************************************************/ | - |
102 | | - |
103 | /* Print a sequence of chars in printable format, stopping at the end of the | - |
104 | subject if the requested. | - |
105 | | - |
106 | Arguments: | - |
107 | p points to characters | - |
108 | length number to print | - |
109 | is_subject TRUE if printing from within md->start_subject | - |
110 | md pointer to matching data block, if is_subject is TRUE | - |
111 | | - |
112 | Returns: nothing | - |
113 | */ | - |
114 | | - |
115 | static void | - |
116 | pchars(const pcre_uchar *p, int length, BOOL is_subject, match_data *md) | - |
117 | { | - |
118 | unsigned int c; | - |
119 | if (is_subject && length > md->end_subject - p) length = md->end_subject - p; | - |
120 | while (length-- > 0) | - |
121 | if (isprint(c = *(p++))) printf("%c", c); else printf("\\x%02x", c); | - |
122 | } | - |
123 | #endif | - |
124 | | - |
125 | | - |
126 | | - |
127 | /************************************************* | - |
128 | * Match a back-reference * | - |
129 | *************************************************/ | - |
130 | | - |
131 | /* Normally, if a back reference hasn't been set, the length that is passed is | - |
132 | negative, so the match always fails. However, in JavaScript compatibility mode, | - |
133 | the length passed is zero. Note that in caseless UTF-8 mode, the number of | - |
134 | subject bytes matched may be different to the number of reference bytes. | - |
135 | | - |
136 | Arguments: | - |
137 | offset index into the offset vector | - |
138 | eptr pointer into the subject | - |
139 | length length of reference to be matched (number of bytes) | - |
140 | md points to match data block | - |
141 | caseless TRUE if caseless | - |
142 | | - |
143 | Returns: < 0 if not matched, otherwise the number of subject bytes matched | - |
144 | */ | - |
145 | | - |
146 | static int | - |
147 | match_ref(int offset, register PCRE_PUCHAR eptr, int length, match_data *md, | - |
148 | BOOL caseless) | - |
149 | { | - |
150 | PCRE_PUCHAR eptr_start = eptr; never executed (the execution status of this line is deduced): const pcre_uchar * eptr_start = eptr; | - |
151 | register PCRE_PUCHAR p = md->start_subject + md->offset_vector[offset]; never executed (the execution status of this line is deduced): register const pcre_uchar * p = md->start_subject + md->offset_vector[offset]; | - |
152 | | - |
153 | #ifdef PCRE_DEBUG | - |
154 | if (eptr >= md->end_subject) | - |
155 | printf("matching subject <null>"); | - |
156 | else | - |
157 | { | - |
158 | printf("matching subject "); | - |
159 | pchars(eptr, length, TRUE, md); | - |
160 | } | - |
161 | printf(" against backref "); | - |
162 | pchars(p, length, FALSE, md); | - |
163 | printf("\n"); | - |
164 | #endif | - |
165 | | - |
166 | /* Always fail if reference not set (and not JavaScript compatible). */ | - |
167 | | - |
168 | if (length < 0) return -1; never executed: return -1; never evaluated: length < 0 | 0 |
169 | | - |
170 | /* Separate the caseless case for speed. In UTF-8 mode we can only do this | - |
171 | properly if Unicode properties are supported. Otherwise, we can check only | - |
172 | ASCII characters. */ | - |
173 | | - |
174 | if (caseless) never evaluated: caseless | 0 |
175 | { | - |
176 | #ifdef SUPPORT_UTF | - |
177 | #ifdef SUPPORT_UCP | - |
178 | if (md->utf) | 0 |
179 | { | - |
180 | /* Match characters up to the end of the reference. NOTE: the number of | - |
181 | bytes matched may differ, because there are some characters whose upper and | - |
182 | lower case versions code as different numbers of bytes. For example, U+023A | - |
183 | (2 bytes in UTF-8) is the upper case version of U+2C65 (3 bytes in UTF-8); | - |
184 | a sequence of 3 of the former uses 6 bytes, as does a sequence of two of | - |
185 | the latter. It is important, therefore, to check the length along the | - |
186 | reference, not along the subject (earlier code did this wrong). */ | - |
187 | | - |
188 | PCRE_PUCHAR endptr = p + length; never executed (the execution status of this line is deduced): const pcre_uchar * endptr = p + length; | - |
189 | while (p < endptr) never evaluated: p < endptr | 0 |
190 | { | - |
191 | int c, d; never executed (the execution status of this line is deduced): int c, d; | - |
192 | if (eptr >= md->end_subject) return -1; never executed: return -1; never evaluated: eptr >= md->end_subject | 0 |
193 | GETCHARINC(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
194 | GETCHARINC(d, p); never executed: } never evaluated: (d & 0xfc00) == 0xd800 | 0 |
195 | if (c != d && c != UCD_OTHERCASE(d)) return -1; never executed: return -1; never evaluated: c != d never evaluated: c != (d + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(d) / 128] * 128 + (d) % 128])->other_case) | 0 |
196 | } | 0 |
197 | } | 0 |
198 | else | - |
199 | #endif | - |
200 | #endif | - |
201 | | - |
202 | /* The same code works when not in UTF-8 mode and in UTF-8 mode when there | - |
203 | is no UCP support. */ | - |
204 | { | - |
205 | if (eptr + length > md->end_subject) return -1; never executed: return -1; never evaluated: eptr + length > md->end_subject | 0 |
206 | while (length-- > 0) never evaluated: length-- > 0 | 0 |
207 | { | - |
208 | if (TABLE_GET(*p, md->lcc, *p) != TABLE_GET(*eptr, md->lcc, *eptr)) return -1; never executed: return -1; never evaluated: (((*p) <= 255u)? ((md->lcc)[*p]):(*p)) != (((*eptr) <= 255u)? ((md->lcc)[*eptr]):(*eptr)) never evaluated: ((*p) <= 255u) never evaluated: ((*eptr) <= 255u) | 0 |
209 | p++; never executed (the execution status of this line is deduced): p++; | - |
210 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
211 | } | 0 |
212 | } | 0 |
213 | } | - |
214 | | - |
215 | /* In the caseful case, we can just compare the bytes, whether or not we | - |
216 | are in UTF-8 mode. */ | - |
217 | | - |
218 | else | - |
219 | { | - |
220 | if (eptr + length > md->end_subject) return -1; never executed: return -1; never evaluated: eptr + length > md->end_subject | 0 |
221 | while (length-- > 0) if (*p++ != *eptr++) return -1; never executed: return -1; never evaluated: *p++ != *eptr++ never evaluated: length-- > 0 | 0 |
222 | } | 0 |
223 | | - |
224 | return (int)(eptr - eptr_start); never executed: return (int)(eptr - eptr_start); | 0 |
225 | } | - |
226 | | - |
227 | | - |
228 | | - |
229 | /*************************************************************************** | - |
230 | **************************************************************************** | - |
231 | RECURSION IN THE match() FUNCTION | - |
232 | | - |
233 | The match() function is highly recursive, though not every recursive call | - |
234 | increases the recursive depth. Nevertheless, some regular expressions can cause | - |
235 | it to recurse to a great depth. I was writing for Unix, so I just let it call | - |
236 | itself recursively. This uses the stack for saving everything that has to be | - |
237 | saved for a recursive call. On Unix, the stack can be large, and this works | - |
238 | fine. | - |
239 | | - |
240 | It turns out that on some non-Unix-like systems there are problems with | - |
241 | programs that use a lot of stack. (This despite the fact that every last chip | - |
242 | has oodles of memory these days, and techniques for extending the stack have | - |
243 | been known for decades.) So.... | - |
244 | | - |
245 | There is a fudge, triggered by defining NO_RECURSE, which avoids recursive | - |
246 | calls by keeping local variables that need to be preserved in blocks of memory | - |
247 | obtained from malloc() instead instead of on the stack. Macros are used to | - |
248 | achieve this so that the actual code doesn't look very different to what it | - |
249 | always used to. | - |
250 | | - |
251 | The original heap-recursive code used longjmp(). However, it seems that this | - |
252 | can be very slow on some operating systems. Following a suggestion from Stan | - |
253 | Switzer, the use of longjmp() has been abolished, at the cost of having to | - |
254 | provide a unique number for each call to RMATCH. There is no way of generating | - |
255 | a sequence of numbers at compile time in C. I have given them names, to make | - |
256 | them stand out more clearly. | - |
257 | | - |
258 | Crude tests on x86 Linux show a small speedup of around 5-8%. However, on | - |
259 | FreeBSD, avoiding longjmp() more than halves the time taken to run the standard | - |
260 | tests. Furthermore, not using longjmp() means that local dynamic variables | - |
261 | don't have indeterminate values; this has meant that the frame size can be | - |
262 | reduced because the result can be "passed back" by straight setting of the | - |
263 | variable instead of being passed in the frame. | - |
264 | **************************************************************************** | - |
265 | ***************************************************************************/ | - |
266 | | - |
267 | /* Numbers for RMATCH calls. When this list is changed, the code at HEAP_RETURN | - |
268 | below must be updated in sync. */ | - |
269 | | - |
270 | enum { RM1=1, RM2, RM3, RM4, RM5, RM6, RM7, RM8, RM9, RM10, | - |
271 | RM11, RM12, RM13, RM14, RM15, RM16, RM17, RM18, RM19, RM20, | - |
272 | RM21, RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30, | - |
273 | RM31, RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40, | - |
274 | RM41, RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50, | - |
275 | RM51, RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60, | - |
276 | RM61, RM62, RM63, RM64, RM65, RM66 }; | - |
277 | | - |
278 | /* These versions of the macros use the stack, as normal. There are debugging | - |
279 | versions and production versions. Note that the "rw" argument of RMATCH isn't | - |
280 | actually used in this definition. */ | - |
281 | | - |
282 | #ifndef NO_RECURSE | - |
283 | #define REGISTER register | - |
284 | | - |
285 | #ifdef PCRE_DEBUG | - |
286 | #define RMATCH(ra,rb,rc,rd,re,rw) \ | - |
287 | { \ | - |
288 | printf("match() called in line %d\n", __LINE__); \ | - |
289 | rrc = match(ra,rb,mstart,rc,rd,re,rdepth+1); \ | - |
290 | printf("to line %d\n", __LINE__); \ | - |
291 | } | - |
292 | #define RRETURN(ra) \ | - |
293 | { \ | - |
294 | printf("match() returned %d from line %d ", ra, __LINE__); \ | - |
295 | return ra; \ | - |
296 | } | - |
297 | #else | - |
298 | #define RMATCH(ra,rb,rc,rd,re,rw) \ | - |
299 | rrc = match(ra,rb,mstart,rc,rd,re,rdepth+1) | - |
300 | #define RRETURN(ra) return ra | - |
301 | #endif | - |
302 | | - |
303 | #else | - |
304 | | - |
305 | | - |
306 | /* These versions of the macros manage a private stack on the heap. Note that | - |
307 | the "rd" argument of RMATCH isn't actually used in this definition. It's the md | - |
308 | argument of match(), which never changes. */ | - |
309 | | - |
310 | #define REGISTER | - |
311 | | - |
312 | #define RMATCH(ra,rb,rc,rd,re,rw)\ | - |
313 | {\ | - |
314 | heapframe *newframe = (heapframe *)(PUBL(stack_malloc))(sizeof(heapframe));\ | - |
315 | if (newframe == NULL) RRETURN(PCRE_ERROR_NOMEMORY);\ | - |
316 | frame->Xwhere = rw; \ | - |
317 | newframe->Xeptr = ra;\ | - |
318 | newframe->Xecode = rb;\ | - |
319 | newframe->Xmstart = mstart;\ | - |
320 | newframe->Xoffset_top = rc;\ | - |
321 | newframe->Xeptrb = re;\ | - |
322 | newframe->Xrdepth = frame->Xrdepth + 1;\ | - |
323 | newframe->Xprevframe = frame;\ | - |
324 | frame = newframe;\ | - |
325 | DPRINTF(("restarting from line %d\n", __LINE__));\ | - |
326 | goto HEAP_RECURSE;\ | - |
327 | L_##rw:\ | - |
328 | DPRINTF(("jumped back to line %d\n", __LINE__));\ | - |
329 | } | - |
330 | | - |
331 | #define RRETURN(ra)\ | - |
332 | {\ | - |
333 | heapframe *oldframe = frame;\ | - |
334 | frame = oldframe->Xprevframe;\ | - |
335 | if (oldframe != &frame_zero) (PUBL(stack_free))(oldframe);\ | - |
336 | if (frame != NULL)\ | - |
337 | {\ | - |
338 | rrc = ra;\ | - |
339 | goto HEAP_RETURN;\ | - |
340 | }\ | - |
341 | return ra;\ | - |
342 | } | - |
343 | | - |
344 | | - |
345 | /* Structure for remembering the local variables in a private frame */ | - |
346 | | - |
347 | typedef struct heapframe { | - |
348 | struct heapframe *Xprevframe; | - |
349 | | - |
350 | /* Function arguments that may change */ | - |
351 | | - |
352 | PCRE_PUCHAR Xeptr; | - |
353 | const pcre_uchar *Xecode; | - |
354 | PCRE_PUCHAR Xmstart; | - |
355 | int Xoffset_top; | - |
356 | eptrblock *Xeptrb; | - |
357 | unsigned int Xrdepth; | - |
358 | | - |
359 | /* Function local variables */ | - |
360 | | - |
361 | PCRE_PUCHAR Xcallpat; | - |
362 | #ifdef SUPPORT_UTF | - |
363 | PCRE_PUCHAR Xcharptr; | - |
364 | #endif | - |
365 | PCRE_PUCHAR Xdata; | - |
366 | PCRE_PUCHAR Xnext; | - |
367 | PCRE_PUCHAR Xpp; | - |
368 | PCRE_PUCHAR Xprev; | - |
369 | PCRE_PUCHAR Xsaved_eptr; | - |
370 | | - |
371 | recursion_info Xnew_recursive; | - |
372 | | - |
373 | BOOL Xcur_is_word; | - |
374 | BOOL Xcondition; | - |
375 | BOOL Xprev_is_word; | - |
376 | | - |
377 | #ifdef SUPPORT_UCP | - |
378 | int Xprop_type; | - |
379 | int Xprop_value; | - |
380 | int Xprop_fail_result; | - |
381 | int Xoclength; | - |
382 | pcre_uchar Xocchars[6]; | - |
383 | #endif | - |
384 | | - |
385 | int Xcodelink; | - |
386 | int Xctype; | - |
387 | unsigned int Xfc; | - |
388 | int Xfi; | - |
389 | int Xlength; | - |
390 | int Xmax; | - |
391 | int Xmin; | - |
392 | int Xnumber; | - |
393 | int Xoffset; | - |
394 | int Xop; | - |
395 | int Xsave_capture_last; | - |
396 | int Xsave_offset1, Xsave_offset2, Xsave_offset3; | - |
397 | int Xstacksave[REC_STACK_SAVE_MAX]; | - |
398 | | - |
399 | eptrblock Xnewptrb; | - |
400 | | - |
401 | /* Where to jump back to */ | - |
402 | | - |
403 | int Xwhere; | - |
404 | | - |
405 | } heapframe; | - |
406 | | - |
407 | #endif | - |
408 | | - |
409 | | - |
410 | /*************************************************************************** | - |
411 | ***************************************************************************/ | - |
412 | | - |
413 | | - |
414 | | - |
415 | /************************************************* | - |
416 | * Match from current position * | - |
417 | *************************************************/ | - |
418 | | - |
419 | /* This function is called recursively in many circumstances. Whenever it | - |
420 | returns a negative (error) response, the outer incarnation must also return the | - |
421 | same response. */ | - |
422 | | - |
423 | /* These macros pack up tests that are used for partial matching, and which | - |
424 | appear several times in the code. We set the "hit end" flag if the pointer is | - |
425 | at the end of the subject and also past the start of the subject (i.e. | - |
426 | something has been matched). For hard partial matching, we then return | - |
427 | immediately. The second one is used when we already know we are past the end of | - |
428 | the subject. */ | - |
429 | | - |
430 | #define CHECK_PARTIAL()\ | - |
431 | if (md->partial != 0 && eptr >= md->end_subject && \ | - |
432 | eptr > md->start_used_ptr) \ | - |
433 | { \ | - |
434 | md->hitend = TRUE; \ | - |
435 | if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); \ | - |
436 | } | - |
437 | | - |
438 | #define SCHECK_PARTIAL()\ | - |
439 | if (md->partial != 0 && eptr > md->start_used_ptr) \ | - |
440 | { \ | - |
441 | md->hitend = TRUE; \ | - |
442 | if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL); \ | - |
443 | } | - |
444 | | - |
445 | | - |
446 | /* Performance note: It might be tempting to extract commonly used fields from | - |
447 | the md structure (e.g. utf, end_subject) into individual variables to improve | - |
448 | performance. Tests using gcc on a SPARC disproved this; in the first case, it | - |
449 | made performance worse. | - |
450 | | - |
451 | Arguments: | - |
452 | eptr pointer to current character in subject | - |
453 | ecode pointer to current position in compiled code | - |
454 | mstart pointer to the current match start position (can be modified | - |
455 | by encountering \K) | - |
456 | offset_top current top pointer | - |
457 | md pointer to "static" info for the match | - |
458 | eptrb pointer to chain of blocks containing eptr at start of | - |
459 | brackets - for testing for empty matches | - |
460 | rdepth the recursion depth | - |
461 | | - |
462 | Returns: MATCH_MATCH if matched ) these values are >= 0 | - |
463 | MATCH_NOMATCH if failed to match ) | - |
464 | a negative MATCH_xxx value for PRUNE, SKIP, etc | - |
465 | a negative PCRE_ERROR_xxx value if aborted by an error condition | - |
466 | (e.g. stopped by repeated call or recursion limit) | - |
467 | */ | - |
468 | | - |
469 | static int | - |
470 | match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode, | - |
471 | PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb, | - |
472 | unsigned int rdepth) | - |
473 | { | - |
474 | /* These variables do not need to be preserved over recursion in this function, | - |
475 | so they can be ordinary variables in all cases. Mark some of them with | - |
476 | "register" because they are used a lot in loops. */ | - |
477 | | - |
478 | register int rrc; /* Returns from recursive calls */ executed (the execution status of this line is deduced): register int rrc; | - |
479 | register int i; /* Used for loops not involving calls to RMATCH() */ executed (the execution status of this line is deduced): register int i; | - |
480 | register unsigned int c; /* Character values not kept over RMATCH() calls */ executed (the execution status of this line is deduced): register unsigned int c; | - |
481 | register BOOL utf; /* Local copy of UTF flag for speed */ executed (the execution status of this line is deduced): register BOOL utf; | - |
482 | | - |
483 | BOOL minimize, possessive; /* Quantifier options */ executed (the execution status of this line is deduced): BOOL minimize, possessive; | - |
484 | BOOL caseless; executed (the execution status of this line is deduced): BOOL caseless; | - |
485 | int condcode; executed (the execution status of this line is deduced): int condcode; | - |
486 | | - |
487 | /* When recursion is not being used, all "local" variables that have to be | - |
488 | preserved over calls to RMATCH() are part of a "frame". We set up the top-level | - |
489 | frame on the stack here; subsequent instantiations are obtained from the heap | - |
490 | whenever RMATCH() does a "recursion". See the macro definitions above. Putting | - |
491 | the top-level on the stack rather than malloc-ing them all gives a performance | - |
492 | boost in many cases where there is not much "recursion". */ | - |
493 | | - |
494 | #ifdef NO_RECURSE | - |
495 | heapframe frame_zero; | - |
496 | heapframe *frame = &frame_zero; | - |
497 | frame->Xprevframe = NULL; /* Marks the top level */ | - |
498 | | - |
499 | /* Copy in the original argument variables */ | - |
500 | | - |
501 | frame->Xeptr = eptr; | - |
502 | frame->Xecode = ecode; | - |
503 | frame->Xmstart = mstart; | - |
504 | frame->Xoffset_top = offset_top; | - |
505 | frame->Xeptrb = eptrb; | - |
506 | frame->Xrdepth = rdepth; | - |
507 | | - |
508 | /* This is where control jumps back to to effect "recursion" */ | - |
509 | | - |
510 | HEAP_RECURSE: | - |
511 | | - |
512 | /* Macros make the argument variables come from the current frame */ | - |
513 | | - |
514 | #define eptr frame->Xeptr | - |
515 | #define ecode frame->Xecode | - |
516 | #define mstart frame->Xmstart | - |
517 | #define offset_top frame->Xoffset_top | - |
518 | #define eptrb frame->Xeptrb | - |
519 | #define rdepth frame->Xrdepth | - |
520 | | - |
521 | /* Ditto for the local variables */ | - |
522 | | - |
523 | #ifdef SUPPORT_UTF | - |
524 | #define charptr frame->Xcharptr | - |
525 | #endif | - |
526 | #define callpat frame->Xcallpat | - |
527 | #define codelink frame->Xcodelink | - |
528 | #define data frame->Xdata | - |
529 | #define next frame->Xnext | - |
530 | #define pp frame->Xpp | - |
531 | #define prev frame->Xprev | - |
532 | #define saved_eptr frame->Xsaved_eptr | - |
533 | | - |
534 | #define new_recursive frame->Xnew_recursive | - |
535 | | - |
536 | #define cur_is_word frame->Xcur_is_word | - |
537 | #define condition frame->Xcondition | - |
538 | #define prev_is_word frame->Xprev_is_word | - |
539 | | - |
540 | #ifdef SUPPORT_UCP | - |
541 | #define prop_type frame->Xprop_type | - |
542 | #define prop_value frame->Xprop_value | - |
543 | #define prop_fail_result frame->Xprop_fail_result | - |
544 | #define oclength frame->Xoclength | - |
545 | #define occhars frame->Xocchars | - |
546 | #endif | - |
547 | | - |
548 | #define ctype frame->Xctype | - |
549 | #define fc frame->Xfc | - |
550 | #define fi frame->Xfi | - |
551 | #define length frame->Xlength | - |
552 | #define max frame->Xmax | - |
553 | #define min frame->Xmin | - |
554 | #define number frame->Xnumber | - |
555 | #define offset frame->Xoffset | - |
556 | #define op frame->Xop | - |
557 | #define save_capture_last frame->Xsave_capture_last | - |
558 | #define save_offset1 frame->Xsave_offset1 | - |
559 | #define save_offset2 frame->Xsave_offset2 | - |
560 | #define save_offset3 frame->Xsave_offset3 | - |
561 | #define stacksave frame->Xstacksave | - |
562 | | - |
563 | #define newptrb frame->Xnewptrb | - |
564 | | - |
565 | /* When recursion is being used, local variables are allocated on the stack and | - |
566 | get preserved during recursion in the normal way. In this environment, fi and | - |
567 | i, and fc and c, can be the same variables. */ | - |
568 | | - |
569 | #else /* NO_RECURSE not defined */ | - |
570 | #define fi i | - |
571 | #define fc c | - |
572 | | - |
573 | /* Many of the following variables are used only in small blocks of the code. | - |
574 | My normal style of coding would have declared them within each of those blocks. | - |
575 | However, in order to accommodate the version of this code that uses an external | - |
576 | "stack" implemented on the heap, it is easier to declare them all here, so the | - |
577 | declarations can be cut out in a block. The only declarations within blocks | - |
578 | below are for variables that do not have to be preserved over a recursive call | - |
579 | to RMATCH(). */ | - |
580 | | - |
581 | #ifdef SUPPORT_UTF | - |
582 | const pcre_uchar *charptr; executed (the execution status of this line is deduced): const pcre_uchar *charptr; | - |
583 | #endif | - |
584 | const pcre_uchar *callpat; executed (the execution status of this line is deduced): const pcre_uchar *callpat; | - |
585 | const pcre_uchar *data; executed (the execution status of this line is deduced): const pcre_uchar *data; | - |
586 | const pcre_uchar *next; executed (the execution status of this line is deduced): const pcre_uchar *next; | - |
587 | PCRE_PUCHAR pp; executed (the execution status of this line is deduced): const pcre_uchar * pp; | - |
588 | const pcre_uchar *prev; executed (the execution status of this line is deduced): const pcre_uchar *prev; | - |
589 | PCRE_PUCHAR saved_eptr; executed (the execution status of this line is deduced): const pcre_uchar * saved_eptr; | - |
590 | | - |
591 | recursion_info new_recursive; executed (the execution status of this line is deduced): recursion_info new_recursive; | - |
592 | | - |
593 | BOOL cur_is_word; executed (the execution status of this line is deduced): BOOL cur_is_word; | - |
594 | BOOL condition; executed (the execution status of this line is deduced): BOOL condition; | - |
595 | BOOL prev_is_word; executed (the execution status of this line is deduced): BOOL prev_is_word; | - |
596 | | - |
597 | #ifdef SUPPORT_UCP | - |
598 | int prop_type; executed (the execution status of this line is deduced): int prop_type; | - |
599 | int prop_value; executed (the execution status of this line is deduced): int prop_value; | - |
600 | int prop_fail_result; executed (the execution status of this line is deduced): int prop_fail_result; | - |
601 | int oclength; executed (the execution status of this line is deduced): int oclength; | - |
602 | pcre_uchar occhars[6]; executed (the execution status of this line is deduced): pcre_uchar occhars[6]; | - |
603 | #endif | - |
604 | | - |
605 | int codelink; executed (the execution status of this line is deduced): int codelink; | - |
606 | int ctype; executed (the execution status of this line is deduced): int ctype; | - |
607 | int length; executed (the execution status of this line is deduced): int length; | - |
608 | int max; executed (the execution status of this line is deduced): int max; | - |
609 | int min; executed (the execution status of this line is deduced): int min; | - |
610 | int number; executed (the execution status of this line is deduced): int number; | - |
611 | int offset; executed (the execution status of this line is deduced): int offset; | - |
612 | int op; executed (the execution status of this line is deduced): int op; | - |
613 | int save_capture_last; executed (the execution status of this line is deduced): int save_capture_last; | - |
614 | int save_offset1, save_offset2, save_offset3; executed (the execution status of this line is deduced): int save_offset1, save_offset2, save_offset3; | - |
615 | int stacksave[REC_STACK_SAVE_MAX]; executed (the execution status of this line is deduced): int stacksave[30]; | - |
616 | | - |
617 | eptrblock newptrb; executed (the execution status of this line is deduced): eptrblock newptrb; | - |
618 | | - |
619 | /* There is a special fudge for calling match() in a way that causes it to | - |
620 | measure the size of its basic stack frame when the stack is being used for | - |
621 | recursion. The second argument (ecode) being NULL triggers this behaviour. It | - |
622 | cannot normally ever be NULL. The return is the negated value of the frame | - |
623 | size. */ | - |
624 | | - |
625 | if (ecode == NULL) partially evaluated: ecode == ((void *)0) no Evaluation Count:0 | yes Evaluation Count:1687 |
| 0-1687 |
626 | { | - |
627 | if (rdepth == 0) never evaluated: rdepth == 0 | 0 |
628 | return match((PCRE_PUCHAR)&rdepth, NULL, NULL, 0, NULL, NULL, 1); never executed: return match((const pcre_uchar *)&rdepth, ((void *)0), ((void *)0), 0, ((void *)0), ((void *)0), 1); | 0 |
629 | else | - |
630 | { | - |
631 | int len = (char *)&rdepth - (char *)eptr; never executed (the execution status of this line is deduced): int len = (char *)&rdepth - (char *)eptr; | - |
632 | return (len > 0)? -len : len; never executed: return (len > 0)? -len : len; | 0 |
633 | } | - |
634 | } | - |
635 | #endif /* NO_RECURSE */ | - |
636 | | - |
637 | /* To save space on the stack and in the heap frame, I have doubled up on some | - |
638 | of the local variables that are used only in localised parts of the code, but | - |
639 | still need to be preserved over recursive calls of match(). These macros define | - |
640 | the alternative names that are used. */ | - |
641 | | - |
642 | #define allow_zero cur_is_word | - |
643 | #define cbegroup condition | - |
644 | #define code_offset codelink | - |
645 | #define condassert condition | - |
646 | #define matched_once prev_is_word | - |
647 | #define foc number | - |
648 | #define save_mark data | - |
649 | | - |
650 | /* These statements are here to stop the compiler complaining about unitialized | - |
651 | variables. */ | - |
652 | | - |
653 | #ifdef SUPPORT_UCP | - |
654 | prop_value = 0; executed (the execution status of this line is deduced): prop_value = 0; | - |
655 | prop_fail_result = 0; executed (the execution status of this line is deduced): prop_fail_result = 0; | - |
656 | #endif | - |
657 | | - |
658 | | - |
659 | /* This label is used for tail recursion, which is used in a few cases even | - |
660 | when NO_RECURSE is not defined, in order to reduce the amount of stack that is | - |
661 | used. Thanks to Ian Taylor for noticing this possibility and sending the | - |
662 | original patch. */ | - |
663 | | - |
664 | TAIL_RECURSE: code before this statement executed: TAIL_RECURSE: Execution Count:1687 | 1687 |
665 | | - |
666 | /* OK, now we can get on with the real code of the function. Recursive calls | - |
667 | are specified by the macro RMATCH and RRETURN is used to return. When | - |
668 | NO_RECURSE is *not* defined, these just turn into a recursive call to match() | - |
669 | and a "return", respectively (possibly with some debugging if PCRE_DEBUG is | - |
670 | defined). However, RMATCH isn't like a function call because it's quite a | - |
671 | complicated macro. It has to be used in one particular way. This shouldn't, | - |
672 | however, impact performance when true recursion is being used. */ | - |
673 | | - |
674 | #ifdef SUPPORT_UTF | - |
675 | utf = md->utf; /* Local copy of the flag */ executed (the execution status of this line is deduced): utf = md->utf; | - |
676 | #else | - |
677 | utf = FALSE; | - |
678 | #endif | - |
679 | | - |
680 | /* First check that we haven't called match() too many times, or that we | - |
681 | haven't exceeded the recursive call limit. */ | - |
682 | | - |
683 | if (md->match_call_count++ >= md->match_limit) RRETURN(PCRE_ERROR_MATCHLIMIT); never executed: return (-8); partially evaluated: md->match_call_count++ >= md->match_limit no Evaluation Count:0 | yes Evaluation Count:2766 |
| 0-2766 |
684 | if (rdepth >= md->match_limit_recursion) RRETURN(PCRE_ERROR_RECURSIONLIMIT); never executed: return (-21); partially evaluated: rdepth >= md->match_limit_recursion no Evaluation Count:0 | yes Evaluation Count:2766 |
| 0-2766 |
685 | | - |
686 | /* At the start of a group with an unlimited repeat that may match an empty | - |
687 | string, the variable md->match_function_type is set to MATCH_CBEGROUP. It is | - |
688 | done this way to save having to use another function argument, which would take | - |
689 | up space on the stack. See also MATCH_CONDASSERT below. | - |
690 | | - |
691 | When MATCH_CBEGROUP is set, add the current subject pointer to the chain of | - |
692 | such remembered pointers, to be checked when we hit the closing ket, in order | - |
693 | to break infinite loops that match no characters. When match() is called in | - |
694 | other circumstances, don't add to the chain. The MATCH_CBEGROUP feature must | - |
695 | NOT be used with tail recursion, because the memory block that is used is on | - |
696 | the stack, so a new one may be required for each match(). */ | - |
697 | | - |
698 | if (md->match_function_type == MATCH_CBEGROUP) partially evaluated: md->match_function_type == 2 no Evaluation Count:0 | yes Evaluation Count:2766 |
| 0-2766 |
699 | { | - |
700 | newptrb.epb_saved_eptr = eptr; never executed (the execution status of this line is deduced): newptrb.epb_saved_eptr = eptr; | - |
701 | newptrb.epb_prev = eptrb; never executed (the execution status of this line is deduced): newptrb.epb_prev = eptrb; | - |
702 | eptrb = &newptrb; never executed (the execution status of this line is deduced): eptrb = &newptrb; | - |
703 | md->match_function_type = 0; never executed (the execution status of this line is deduced): md->match_function_type = 0; | - |
704 | } | 0 |
705 | | - |
706 | /* Now start processing the opcodes. */ | - |
707 | | - |
708 | for (;;) executed (the execution status of this line is deduced): for (;;) | - |
709 | { | - |
710 | minimize = possessive = FALSE; executed (the execution status of this line is deduced): minimize = possessive = 0; | - |
711 | op = *ecode; executed (the execution status of this line is deduced): op = *ecode; | - |
712 | | - |
713 | switch(op) | - |
714 | { | - |
715 | case OP_MARK: | - |
716 | md->nomatch_mark = ecode + 2; never executed (the execution status of this line is deduced): md->nomatch_mark = ecode + 2; | - |
717 | md->mark = NULL; /* In case previously set by assertion */ never executed (the execution status of this line is deduced): md->mark = ((void *)0); | - |
718 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode] + ecode[1],mstart,offset_top,md,eptrb,rdepth+1); | - |
719 | eptrb, RM55); | - |
720 | if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) && never evaluated: rrc == 1 never evaluated: rrc == (-999) | 0 |
721 | md->mark == NULL) md->mark = ecode + 2; never executed: md->mark = ecode + 2; never evaluated: md->mark == ((void *)0) | 0 |
722 | | - |
723 | /* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an | - |
724 | argument, and we must check whether that argument matches this MARK's | - |
725 | argument. It is passed back in md->start_match_ptr (an overloading of that | - |
726 | variable). If it does match, we reset that variable to the current subject | - |
727 | position and return MATCH_SKIP. Otherwise, pass back the return code | - |
728 | unaltered. */ | - |
729 | | - |
730 | else if (rrc == MATCH_SKIP_ARG && never evaluated: rrc == (-993) | 0 |
731 | STRCMP_UC_UC(ecode + 2, md->start_match_ptr) == 0) never evaluated: _pcre16_strcmp_uc_uc((ecode + 2), (md->start_match_ptr)) == 0 | 0 |
732 | { | - |
733 | md->start_match_ptr = eptr; never executed (the execution status of this line is deduced): md->start_match_ptr = eptr; | - |
734 | RRETURN(MATCH_SKIP); never executed: return (-994); | 0 |
735 | } | - |
736 | RRETURN(rrc); never executed: return rrc; | 0 |
737 | | - |
738 | case OP_FAIL: | - |
739 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
740 | | - |
741 | /* COMMIT overrides PRUNE, SKIP, and THEN */ | - |
742 | | - |
743 | case OP_COMMIT: | - |
744 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode],mstart,offset_top,md,eptrb,rdepth+1); | - |
745 | eptrb, RM52); | - |
746 | if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && never evaluated: rrc != 0 never evaluated: rrc != (-995) | 0 |
747 | rrc != MATCH_SKIP && rrc != MATCH_SKIP_ARG && never evaluated: rrc != (-994) never evaluated: rrc != (-993) | 0 |
748 | rrc != MATCH_THEN) never evaluated: rrc != (-992) | 0 |
749 | RRETURN(rrc); never executed: return rrc; | 0 |
750 | RRETURN(MATCH_COMMIT); never executed: return (-998); | 0 |
751 | | - |
752 | /* PRUNE overrides THEN */ | - |
753 | | - |
754 | case OP_PRUNE: | - |
755 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode],mstart,offset_top,md,eptrb,rdepth+1); | - |
756 | eptrb, RM51); | - |
757 | if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 never evaluated: rrc != (-992) | 0 |
758 | RRETURN(MATCH_PRUNE); never executed: return (-995); | 0 |
759 | | - |
760 | case OP_PRUNE_ARG: | - |
761 | md->nomatch_mark = ecode + 2; never executed (the execution status of this line is deduced): md->nomatch_mark = ecode + 2; | - |
762 | md->mark = NULL; /* In case previously set by assertion */ never executed (the execution status of this line is deduced): md->mark = ((void *)0); | - |
763 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode] + ecode[1],mstart,offset_top,md,eptrb,rdepth+1); | - |
764 | eptrb, RM56); | - |
765 | if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) && never evaluated: rrc == 1 never evaluated: rrc == (-999) | 0 |
766 | md->mark == NULL) md->mark = ecode + 2; never executed: md->mark = ecode + 2; never evaluated: md->mark == ((void *)0) | 0 |
767 | if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 never evaluated: rrc != (-992) | 0 |
768 | RRETURN(MATCH_PRUNE); never executed: return (-995); | 0 |
769 | | - |
770 | /* SKIP overrides PRUNE and THEN */ | - |
771 | | - |
772 | case OP_SKIP: | - |
773 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode],mstart,offset_top,md,eptrb,rdepth+1); | - |
774 | eptrb, RM53); | - |
775 | if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN) never evaluated: rrc != 0 never evaluated: rrc != (-995) never evaluated: rrc != (-992) | 0 |
776 | RRETURN(rrc); never executed: return rrc; | 0 |
777 | md->start_match_ptr = eptr; /* Pass back current position */ never executed (the execution status of this line is deduced): md->start_match_ptr = eptr; | - |
778 | RRETURN(MATCH_SKIP); never executed: return (-994); | 0 |
779 | | - |
780 | /* Note that, for Perl compatibility, SKIP with an argument does NOT set | - |
781 | nomatch_mark. There is a flag that disables this opcode when re-matching a | - |
782 | pattern that ended with a SKIP for which there was not a matching MARK. */ | - |
783 | | - |
784 | case OP_SKIP_ARG: | - |
785 | if (md->ignore_skip_arg) never evaluated: md->ignore_skip_arg | 0 |
786 | { | - |
787 | ecode += PRIV(OP_lengths)[*ecode] + ecode[1]; never executed (the execution status of this line is deduced): ecode += _pcre16_OP_lengths[*ecode] + ecode[1]; | - |
788 | break; | 0 |
789 | } | - |
790 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode] + ecode[1],mstart,offset_top,md,eptrb,rdepth+1); | - |
791 | eptrb, RM57); | - |
792 | if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN) never evaluated: rrc != 0 never evaluated: rrc != (-995) never evaluated: rrc != (-992) | 0 |
793 | RRETURN(rrc); never executed: return rrc; | 0 |
794 | | - |
795 | /* Pass back the current skip name by overloading md->start_match_ptr and | - |
796 | returning the special MATCH_SKIP_ARG return code. This will either be | - |
797 | caught by a matching MARK, or get to the top, where it causes a rematch | - |
798 | with the md->ignore_skip_arg flag set. */ | - |
799 | | - |
800 | md->start_match_ptr = ecode + 2; never executed (the execution status of this line is deduced): md->start_match_ptr = ecode + 2; | - |
801 | RRETURN(MATCH_SKIP_ARG); never executed: return (-993); | 0 |
802 | | - |
803 | /* For THEN (and THEN_ARG) we pass back the address of the opcode, so that | - |
804 | the branch in which it occurs can be determined. Overload the start of | - |
805 | match pointer to do this. */ | - |
806 | | - |
807 | case OP_THEN: | - |
808 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode],mstart,offset_top,md,eptrb,rdepth+1); | - |
809 | eptrb, RM54); | - |
810 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
811 | md->start_match_ptr = ecode; never executed (the execution status of this line is deduced): md->start_match_ptr = ecode; | - |
812 | RRETURN(MATCH_THEN); never executed: return (-992); | 0 |
813 | | - |
814 | case OP_THEN_ARG: | - |
815 | md->nomatch_mark = ecode + 2; never executed (the execution status of this line is deduced): md->nomatch_mark = ecode + 2; | - |
816 | md->mark = NULL; /* In case previously set by assertion */ never executed (the execution status of this line is deduced): md->mark = ((void *)0); | - |
817 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode] + ecode[1], offset_top, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode] + ecode[1],mstart,offset_top,md,eptrb,rdepth+1); | - |
818 | md, eptrb, RM58); | - |
819 | if ((rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) && never evaluated: rrc == 1 never evaluated: rrc == (-999) | 0 |
820 | md->mark == NULL) md->mark = ecode + 2; never executed: md->mark = ecode + 2; never evaluated: md->mark == ((void *)0) | 0 |
821 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
822 | md->start_match_ptr = ecode; never executed (the execution status of this line is deduced): md->start_match_ptr = ecode; | - |
823 | RRETURN(MATCH_THEN); never executed: return (-992); | 0 |
824 | | - |
825 | /* Handle an atomic group that does not contain any capturing parentheses. | - |
826 | This can be handled like an assertion. Prior to 8.13, all atomic groups | - |
827 | were handled this way. In 8.13, the code was changed as below for ONCE, so | - |
828 | that backups pass through the group and thereby reset captured values. | - |
829 | However, this uses a lot more stack, so in 8.20, atomic groups that do not | - |
830 | contain any captures generate OP_ONCE_NC, which can be handled in the old, | - |
831 | less stack intensive way. | - |
832 | | - |
833 | Check the alternative branches in turn - the matching won't pass the KET | - |
834 | for this kind of subpattern. If any one branch matches, we carry on as at | - |
835 | the end of a normal bracket, leaving the subject pointer, but resetting | - |
836 | the start-of-match value in case it was changed by \K. */ | - |
837 | | - |
838 | case OP_ONCE_NC: | - |
839 | prev = ecode; never executed (the execution status of this line is deduced): prev = ecode; | - |
840 | saved_eptr = eptr; never executed (the execution status of this line is deduced): saved_eptr = eptr; | - |
841 | save_mark = md->mark; never executed (the execution status of this line is deduced): data = md->mark; | - |
842 | do | - |
843 | { | - |
844 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM64); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,eptrb,rdepth+1); | - |
845 | if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */ never evaluated: rrc == 1 | 0 |
846 | { | - |
847 | mstart = md->start_match_ptr; never executed (the execution status of this line is deduced): mstart = md->start_match_ptr; | - |
848 | break; | 0 |
849 | } | - |
850 | if (rrc == MATCH_THEN) never evaluated: rrc == (-992) | 0 |
851 | { | - |
852 | next = ecode + GET(ecode,1); never executed (the execution status of this line is deduced): next = ecode + (ecode[1]); | - |
853 | if (md->start_match_ptr < next && never evaluated: md->start_match_ptr < next | 0 |
854 | (*ecode == OP_ALT || *next == OP_ALT)) never evaluated: *ecode == OP_ALT never evaluated: *next == OP_ALT | 0 |
855 | rrc = MATCH_NOMATCH; | 0 |
856 | } | 0 |
857 | | - |
858 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
859 | ecode += GET(ecode,1); never executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
860 | md->mark = save_mark; never executed (the execution status of this line is deduced): md->mark = data; | - |
861 | } | 0 |
862 | while (*ecode == OP_ALT); never evaluated: *ecode == OP_ALT | 0 |
863 | | - |
864 | /* If hit the end of the group (which could be repeated), fail */ | - |
865 | | - |
866 | if (*ecode != OP_ONCE_NC && *ecode != OP_ALT) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: *ecode != OP_ONCE_NC never evaluated: *ecode != OP_ALT | 0 |
867 | | - |
868 | /* Continue as from after the group, updating the offsets high water | - |
869 | mark, since extracts may have been taken. */ | - |
870 | | - |
871 | do ecode += GET(ecode, 1); while (*ecode == OP_ALT); never executed: ecode += (ecode[1]); never evaluated: *ecode == OP_ALT | 0 |
872 | | - |
873 | offset_top = md->end_offset_top; never executed (the execution status of this line is deduced): offset_top = md->end_offset_top; | - |
874 | eptr = md->end_match_ptr; never executed (the execution status of this line is deduced): eptr = md->end_match_ptr; | - |
875 | | - |
876 | /* For a non-repeating ket, just continue at this level. This also | - |
877 | happens for a repeating ket if no characters were matched in the group. | - |
878 | This is the forcible breaking of infinite loops as implemented in Perl | - |
879 | 5.005. */ | - |
880 | | - |
881 | if (*ecode == OP_KET || eptr == saved_eptr) never evaluated: *ecode == OP_KET never evaluated: eptr == saved_eptr | 0 |
882 | { | - |
883 | ecode += 1+LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1+1; | - |
884 | break; | 0 |
885 | } | - |
886 | | - |
887 | /* The repeating kets try the rest of the pattern or restart from the | - |
888 | preceding bracket, in the appropriate order. The second "call" of match() | - |
889 | uses tail recursion, to avoid using another stack frame. */ | - |
890 | | - |
891 | if (*ecode == OP_KETRMIN) never evaluated: *ecode == OP_KETRMIN | 0 |
892 | { | - |
893 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM65); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,eptrb,rdepth+1); | - |
894 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
895 | ecode = prev; never executed (the execution status of this line is deduced): ecode = prev; | - |
896 | goto TAIL_RECURSE; never executed: goto TAIL_RECURSE; | 0 |
897 | } | - |
898 | else /* OP_KETRMAX */ | - |
899 | { | - |
900 | md->match_function_type = MATCH_CBEGROUP; never executed (the execution status of this line is deduced): md->match_function_type = 2; | - |
901 | RMATCH(eptr, prev, offset_top, md, eptrb, RM66); never executed (the execution status of this line is deduced): rrc = match(eptr,prev,mstart,offset_top,md,eptrb,rdepth+1); | - |
902 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
903 | ecode += 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
904 | goto TAIL_RECURSE; never executed: goto TAIL_RECURSE; | 0 |
905 | } | - |
906 | /* Control never gets here */ | - |
907 | | - |
908 | /* Handle a capturing bracket, other than those that are possessive with an | - |
909 | unlimited repeat. If there is space in the offset vector, save the current | - |
910 | subject position in the working slot at the top of the vector. We mustn't | - |
911 | change the current values of the data slot, because they may be set from a | - |
912 | previous iteration of this group, and be referred to by a reference inside | - |
913 | the group. A failure to match might occur after the group has succeeded, | - |
914 | if something later on doesn't match. For this reason, we need to restore | - |
915 | the working value and also the values of the final offsets, in case they | - |
916 | were set by a previous iteration of the same bracket. | - |
917 | | - |
918 | If there isn't enough space in the offset vector, treat this as if it were | - |
919 | a non-capturing bracket. Don't worry about setting the flag for the error | - |
920 | case here; that is handled in the code for KET. */ | - |
921 | | - |
922 | case OP_CBRA: | - |
923 | case OP_SCBRA: | - |
924 | number = GET2(ecode, 1+LINK_SIZE); executed (the execution status of this line is deduced): number = ecode[1+1]; | - |
925 | offset = number << 1; executed (the execution status of this line is deduced): offset = number << 1; | - |
926 | | - |
927 | #ifdef PCRE_DEBUG | - |
928 | printf("start bracket %d\n", number); | - |
929 | printf("subject="); | - |
930 | pchars(eptr, 16, TRUE, md); | - |
931 | printf("\n"); | - |
932 | #endif | - |
933 | | - |
934 | if (offset < md->offset_max) partially evaluated: offset < md->offset_max yes Evaluation Count:208 | no Evaluation Count:0 |
| 0-208 |
935 | { | - |
936 | save_offset1 = md->offset_vector[offset]; executed (the execution status of this line is deduced): save_offset1 = md->offset_vector[offset]; | - |
937 | save_offset2 = md->offset_vector[offset+1]; executed (the execution status of this line is deduced): save_offset2 = md->offset_vector[offset+1]; | - |
938 | save_offset3 = md->offset_vector[md->offset_end - number]; executed (the execution status of this line is deduced): save_offset3 = md->offset_vector[md->offset_end - number]; | - |
939 | save_capture_last = md->capture_last; executed (the execution status of this line is deduced): save_capture_last = md->capture_last; | - |
940 | save_mark = md->mark; executed (the execution status of this line is deduced): data = md->mark; | - |
941 | | - |
942 | DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3)); | - |
943 | md->offset_vector[md->offset_end - number] = executed (the execution status of this line is deduced): md->offset_vector[md->offset_end - number] = | - |
944 | (int)(eptr - md->start_subject); executed (the execution status of this line is deduced): (int)(eptr - md->start_subject); | - |
945 | | - |
946 | for (;;) executed (the execution status of this line is deduced): for (;;) | - |
947 | { | - |
948 | if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP; never executed: md->match_function_type = 2; partially evaluated: op >= OP_SBRA no Evaluation Count:0 | yes Evaluation Count:208 |
| 0-208 |
949 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode],mstart,offset_top,md,eptrb,rdepth+1); | - |
950 | eptrb, RM1); | - |
951 | if (rrc == MATCH_ONCE) break; /* Backing up through an atomic group */ never executed: break; partially evaluated: rrc == (-996) no Evaluation Count:0 | yes Evaluation Count:208 |
| 0-208 |
952 | | - |
953 | /* If we backed up to a THEN, check whether it is within the current | - |
954 | branch by comparing the address of the THEN that is passed back with | - |
955 | the end of the branch. If it is within the current branch, and the | - |
956 | branch is one of two or more alternatives (it either starts or ends | - |
957 | with OP_ALT), we have reached the limit of THEN's action, so convert | - |
958 | the return code to NOMATCH, which will cause normal backtracking to | - |
959 | happen from now on. Otherwise, THEN is passed back to an outer | - |
960 | alternative. This implements Perl's treatment of parenthesized groups, | - |
961 | where a group not containing | does not affect the current alternative, | - |
962 | that is, (X) is NOT the same as (X|(*F)). */ | - |
963 | | - |
964 | if (rrc == MATCH_THEN) partially evaluated: rrc == (-992) no Evaluation Count:0 | yes Evaluation Count:208 |
| 0-208 |
965 | { | - |
966 | next = ecode + GET(ecode,1); never executed (the execution status of this line is deduced): next = ecode + (ecode[1]); | - |
967 | if (md->start_match_ptr < next && never evaluated: md->start_match_ptr < next | 0 |
968 | (*ecode == OP_ALT || *next == OP_ALT)) never evaluated: *ecode == OP_ALT never evaluated: *next == OP_ALT | 0 |
969 | rrc = MATCH_NOMATCH; | 0 |
970 | } | 0 |
971 | | - |
972 | /* Anything other than NOMATCH is passed back. */ | - |
973 | | - |
974 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:155 evaluated: rrc != 0 yes Evaluation Count:155 | yes Evaluation Count:53 |
| 53-155 |
975 | md->capture_last = save_capture_last; executed (the execution status of this line is deduced): md->capture_last = save_capture_last; | - |
976 | ecode += GET(ecode, 1); executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
977 | md->mark = save_mark; executed (the execution status of this line is deduced): md->mark = data; | - |
978 | if (*ecode != OP_ALT) break; executed: break; Execution Count:53 partially evaluated: *ecode != OP_ALT yes Evaluation Count:53 | no Evaluation Count:0 |
| 0-53 |
979 | } | 0 |
980 | | - |
981 | DPRINTF(("bracket %d failed\n", number)); | - |
982 | md->offset_vector[offset] = save_offset1; executed (the execution status of this line is deduced): md->offset_vector[offset] = save_offset1; | - |
983 | md->offset_vector[offset+1] = save_offset2; executed (the execution status of this line is deduced): md->offset_vector[offset+1] = save_offset2; | - |
984 | md->offset_vector[md->offset_end - number] = save_offset3; executed (the execution status of this line is deduced): md->offset_vector[md->offset_end - number] = save_offset3; | - |
985 | | - |
986 | /* At this point, rrc will be one of MATCH_ONCE or MATCH_NOMATCH. */ | - |
987 | | - |
988 | RRETURN(rrc); executed: return rrc; Execution Count:53 | 53 |
989 | } | - |
990 | | - |
991 | /* FALL THROUGH ... Insufficient room for saving captured contents. Treat | - |
992 | as a non-capturing bracket. */ | - |
993 | | - |
994 | /* VVVVVVVVVVVVVVVVVVVVVVVVV */ | - |
995 | /* VVVVVVVVVVVVVVVVVVVVVVVVV */ | - |
996 | | - |
997 | DPRINTF(("insufficient capture room: treat as non-capturing\n")); | - |
998 | | - |
999 | /* VVVVVVVVVVVVVVVVVVVVVVVVV */ | - |
1000 | /* VVVVVVVVVVVVVVVVVVVVVVVVV */ | - |
1001 | | - |
1002 | /* Non-capturing or atomic group, except for possessive with unlimited | - |
1003 | repeat and ONCE group with no captures. Loop for all the alternatives. | - |
1004 | | - |
1005 | When we get to the final alternative within the brackets, we used to return | - |
1006 | the result of a recursive call to match() whatever happened so it was | - |
1007 | possible to reduce stack usage by turning this into a tail recursion, | - |
1008 | except in the case of a possibly empty group. However, now that there is | - |
1009 | the possiblity of (*THEN) occurring in the final alternative, this | - |
1010 | optimization is no longer always possible. | - |
1011 | | - |
1012 | We can optimize if we know there are no (*THEN)s in the pattern; at present | - |
1013 | this is the best that can be done. | - |
1014 | | - |
1015 | MATCH_ONCE is returned when the end of an atomic group is successfully | - |
1016 | reached, but subsequent matching fails. It passes back up the tree (causing | - |
1017 | captured values to be reset) until the original atomic group level is | - |
1018 | reached. This is tested by comparing md->once_target with the start of the | - |
1019 | group. At this point, the return is converted into MATCH_NOMATCH so that | - |
1020 | previous backup points can be taken. */ | - |
1021 | | - |
1022 | case OP_ONCE: code before this statement never executed: case OP_ONCE: | 0 |
1023 | case OP_BRA: | - |
1024 | case OP_SBRA: | - |
1025 | DPRINTF(("start non-capturing bracket\n")); | - |
1026 | | - |
1027 | for (;;) executed (the execution status of this line is deduced): for (;;) | - |
1028 | { | - |
1029 | if (op >= OP_SBRA || op == OP_ONCE) md->match_function_type = MATCH_CBEGROUP; never executed: md->match_function_type = 2; partially evaluated: op >= OP_SBRA no Evaluation Count:0 | yes Evaluation Count:1117 |
partially evaluated: op == OP_ONCE no Evaluation Count:0 | yes Evaluation Count:1117 |
| 0-1117 |
1030 | | - |
1031 | /* If this is not a possibly empty group, and there are no (*THEN)s in | - |
1032 | the pattern, and this is the final alternative, optimize as described | - |
1033 | above. */ | - |
1034 | | - |
1035 | else if (!md->hasthen && ecode[GET(ecode, 1)] != OP_ALT) partially evaluated: !md->hasthen yes Evaluation Count:1117 | no Evaluation Count:0 |
evaluated: ecode[(ecode[1])] != OP_ALT yes Evaluation Count:1055 | yes Evaluation Count:62 |
| 0-1117 |
1036 | { | - |
1037 | ecode += PRIV(OP_lengths)[*ecode]; executed (the execution status of this line is deduced): ecode += _pcre16_OP_lengths[*ecode]; | - |
1038 | goto TAIL_RECURSE; executed: goto TAIL_RECURSE; Execution Count:1055 | 1055 |
1039 | } | - |
1040 | | - |
1041 | /* In all other cases, we have to make another call to match(). */ | - |
1042 | | - |
1043 | save_mark = md->mark; executed (the execution status of this line is deduced): data = md->mark; | - |
1044 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, eptrb, executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode],mstart,offset_top,md,eptrb,rdepth+1); | - |
1045 | RM2); | - |
1046 | | - |
1047 | /* See comment in the code for capturing groups above about handling | - |
1048 | THEN. */ | - |
1049 | | - |
1050 | if (rrc == MATCH_THEN) partially evaluated: rrc == (-992) no Evaluation Count:0 | yes Evaluation Count:62 |
| 0-62 |
1051 | { | - |
1052 | next = ecode + GET(ecode,1); never executed (the execution status of this line is deduced): next = ecode + (ecode[1]); | - |
1053 | if (md->start_match_ptr < next && never evaluated: md->start_match_ptr < next | 0 |
1054 | (*ecode == OP_ALT || *next == OP_ALT)) never evaluated: *ecode == OP_ALT never evaluated: *next == OP_ALT | 0 |
1055 | rrc = MATCH_NOMATCH; | 0 |
1056 | } | 0 |
1057 | | - |
1058 | if (rrc != MATCH_NOMATCH) evaluated: rrc != 0 yes Evaluation Count:8 | yes Evaluation Count:54 |
| 8-54 |
1059 | { | - |
1060 | if (rrc == MATCH_ONCE) partially evaluated: rrc == (-996) no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
1061 | { | - |
1062 | const pcre_uchar *scode = ecode; never executed (the execution status of this line is deduced): const pcre_uchar *scode = ecode; | - |
1063 | if (*scode != OP_ONCE) /* If not at start, find it */ never evaluated: *scode != OP_ONCE | 0 |
1064 | { | - |
1065 | while (*scode == OP_ALT) scode += GET(scode, 1); never executed: scode += (scode[1]); never evaluated: *scode == OP_ALT | 0 |
1066 | scode -= GET(scode, 1); never executed (the execution status of this line is deduced): scode -= (scode[1]); | - |
1067 | } | 0 |
1068 | if (md->once_target == scode) rrc = MATCH_NOMATCH; never executed: rrc = 0; never evaluated: md->once_target == scode | 0 |
1069 | } | 0 |
1070 | RRETURN(rrc); executed: return rrc; Execution Count:8 | 8 |
1071 | } | - |
1072 | ecode += GET(ecode, 1); executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
1073 | md->mark = save_mark; executed (the execution status of this line is deduced): md->mark = data; | - |
1074 | if (*ecode != OP_ALT) break; never executed: break; partially evaluated: *ecode != OP_ALT no Evaluation Count:0 | yes Evaluation Count:54 |
| 0-54 |
1075 | } executed: } Execution Count:54 | 54 |
1076 | | - |
1077 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
1078 | | - |
1079 | /* Handle possessive capturing brackets with an unlimited repeat. We come | - |
1080 | here from BRAZERO with allow_zero set TRUE. The offset_vector values are | - |
1081 | handled similarly to the normal case above. However, the matching is | - |
1082 | different. The end of these brackets will always be OP_KETRPOS, which | - |
1083 | returns MATCH_KETRPOS without going further in the pattern. By this means | - |
1084 | we can handle the group by iteration rather than recursion, thereby | - |
1085 | reducing the amount of stack needed. */ | - |
1086 | | - |
1087 | case OP_CBRAPOS: | - |
1088 | case OP_SCBRAPOS: | - |
1089 | allow_zero = FALSE; never executed (the execution status of this line is deduced): cur_is_word = 0; | - |
1090 | | - |
1091 | POSSESSIVE_CAPTURE: code before this statement never executed: POSSESSIVE_CAPTURE: | 0 |
1092 | number = GET2(ecode, 1+LINK_SIZE); never executed (the execution status of this line is deduced): number = ecode[1+1]; | - |
1093 | offset = number << 1; never executed (the execution status of this line is deduced): offset = number << 1; | - |
1094 | | - |
1095 | #ifdef PCRE_DEBUG | - |
1096 | printf("start possessive bracket %d\n", number); | - |
1097 | printf("subject="); | - |
1098 | pchars(eptr, 16, TRUE, md); | - |
1099 | printf("\n"); | - |
1100 | #endif | - |
1101 | | - |
1102 | if (offset < md->offset_max) never evaluated: offset < md->offset_max | 0 |
1103 | { | - |
1104 | matched_once = FALSE; never executed (the execution status of this line is deduced): prev_is_word = 0; | - |
1105 | code_offset = (int)(ecode - md->start_code); never executed (the execution status of this line is deduced): codelink = (int)(ecode - md->start_code); | - |
1106 | | - |
1107 | save_offset1 = md->offset_vector[offset]; never executed (the execution status of this line is deduced): save_offset1 = md->offset_vector[offset]; | - |
1108 | save_offset2 = md->offset_vector[offset+1]; never executed (the execution status of this line is deduced): save_offset2 = md->offset_vector[offset+1]; | - |
1109 | save_offset3 = md->offset_vector[md->offset_end - number]; never executed (the execution status of this line is deduced): save_offset3 = md->offset_vector[md->offset_end - number]; | - |
1110 | save_capture_last = md->capture_last; never executed (the execution status of this line is deduced): save_capture_last = md->capture_last; | - |
1111 | | - |
1112 | DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3)); | - |
1113 | | - |
1114 | /* Each time round the loop, save the current subject position for use | - |
1115 | when the group matches. For MATCH_MATCH, the group has matched, so we | - |
1116 | restart it with a new subject starting position, remembering that we had | - |
1117 | at least one match. For MATCH_NOMATCH, carry on with the alternatives, as | - |
1118 | usual. If we haven't matched any alternatives in any iteration, check to | - |
1119 | see if a previous iteration matched. If so, the group has matched; | - |
1120 | continue from afterwards. Otherwise it has failed; restore the previous | - |
1121 | capture values before returning NOMATCH. */ | - |
1122 | | - |
1123 | for (;;) never executed (the execution status of this line is deduced): for (;;) | - |
1124 | { | - |
1125 | md->offset_vector[md->offset_end - number] = never executed (the execution status of this line is deduced): md->offset_vector[md->offset_end - number] = | - |
1126 | (int)(eptr - md->start_subject); never executed (the execution status of this line is deduced): (int)(eptr - md->start_subject); | - |
1127 | if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP; never executed: md->match_function_type = 2; never evaluated: op >= OP_SBRA | 0 |
1128 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode],mstart,offset_top,md,eptrb,rdepth+1); | - |
1129 | eptrb, RM63); | - |
1130 | if (rrc == MATCH_KETRPOS) never evaluated: rrc == (-997) | 0 |
1131 | { | - |
1132 | offset_top = md->end_offset_top; never executed (the execution status of this line is deduced): offset_top = md->end_offset_top; | - |
1133 | eptr = md->end_match_ptr; never executed (the execution status of this line is deduced): eptr = md->end_match_ptr; | - |
1134 | ecode = md->start_code + code_offset; never executed (the execution status of this line is deduced): ecode = md->start_code + codelink; | - |
1135 | save_capture_last = md->capture_last; never executed (the execution status of this line is deduced): save_capture_last = md->capture_last; | - |
1136 | matched_once = TRUE; never executed (the execution status of this line is deduced): prev_is_word = 1; | - |
1137 | continue; never executed: continue; | 0 |
1138 | } | - |
1139 | | - |
1140 | /* See comment in the code for capturing groups above about handling | - |
1141 | THEN. */ | - |
1142 | | - |
1143 | if (rrc == MATCH_THEN) never evaluated: rrc == (-992) | 0 |
1144 | { | - |
1145 | next = ecode + GET(ecode,1); never executed (the execution status of this line is deduced): next = ecode + (ecode[1]); | - |
1146 | if (md->start_match_ptr < next && never evaluated: md->start_match_ptr < next | 0 |
1147 | (*ecode == OP_ALT || *next == OP_ALT)) never evaluated: *ecode == OP_ALT never evaluated: *next == OP_ALT | 0 |
1148 | rrc = MATCH_NOMATCH; | 0 |
1149 | } | 0 |
1150 | | - |
1151 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
1152 | md->capture_last = save_capture_last; never executed (the execution status of this line is deduced): md->capture_last = save_capture_last; | - |
1153 | ecode += GET(ecode, 1); never executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
1154 | if (*ecode != OP_ALT) break; never executed: break; never evaluated: *ecode != OP_ALT | 0 |
1155 | } | 0 |
1156 | | - |
1157 | if (!matched_once) never evaluated: !prev_is_word | 0 |
1158 | { | - |
1159 | md->offset_vector[offset] = save_offset1; never executed (the execution status of this line is deduced): md->offset_vector[offset] = save_offset1; | - |
1160 | md->offset_vector[offset+1] = save_offset2; never executed (the execution status of this line is deduced): md->offset_vector[offset+1] = save_offset2; | - |
1161 | md->offset_vector[md->offset_end - number] = save_offset3; never executed (the execution status of this line is deduced): md->offset_vector[md->offset_end - number] = save_offset3; | - |
1162 | } | 0 |
1163 | | - |
1164 | if (allow_zero || matched_once) never evaluated: cur_is_word never evaluated: prev_is_word | 0 |
1165 | { | - |
1166 | ecode += 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1167 | break; | 0 |
1168 | } | - |
1169 | | - |
1170 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
1171 | } | - |
1172 | | - |
1173 | /* FALL THROUGH ... Insufficient room for saving captured contents. Treat | - |
1174 | as a non-capturing bracket. */ | - |
1175 | | - |
1176 | /* VVVVVVVVVVVVVVVVVVVVVVVVV */ | - |
1177 | /* VVVVVVVVVVVVVVVVVVVVVVVVV */ | - |
1178 | | - |
1179 | DPRINTF(("insufficient capture room: treat as non-capturing\n")); | - |
1180 | | - |
1181 | /* VVVVVVVVVVVVVVVVVVVVVVVVV */ | - |
1182 | /* VVVVVVVVVVVVVVVVVVVVVVVVV */ | - |
1183 | | - |
1184 | /* Non-capturing possessive bracket with unlimited repeat. We come here | - |
1185 | from BRAZERO with allow_zero = TRUE. The code is similar to the above, | - |
1186 | without the capturing complication. It is written out separately for speed | - |
1187 | and cleanliness. */ | - |
1188 | | - |
1189 | case OP_BRAPOS: code before this statement never executed: case OP_BRAPOS: | 0 |
1190 | case OP_SBRAPOS: | - |
1191 | allow_zero = FALSE; never executed (the execution status of this line is deduced): cur_is_word = 0; | - |
1192 | | - |
1193 | POSSESSIVE_NON_CAPTURE: code before this statement never executed: POSSESSIVE_NON_CAPTURE: | 0 |
1194 | matched_once = FALSE; never executed (the execution status of this line is deduced): prev_is_word = 0; | - |
1195 | code_offset = (int)(ecode - md->start_code); never executed (the execution status of this line is deduced): codelink = (int)(ecode - md->start_code); | - |
1196 | | - |
1197 | for (;;) never executed (the execution status of this line is deduced): for (;;) | - |
1198 | { | - |
1199 | if (op >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP; never executed: md->match_function_type = 2; never evaluated: op >= OP_SBRA | 0 |
1200 | RMATCH(eptr, ecode + PRIV(OP_lengths)[*ecode], offset_top, md, never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + _pcre16_OP_lengths[*ecode],mstart,offset_top,md,eptrb,rdepth+1); | - |
1201 | eptrb, RM48); | - |
1202 | if (rrc == MATCH_KETRPOS) never evaluated: rrc == (-997) | 0 |
1203 | { | - |
1204 | offset_top = md->end_offset_top; never executed (the execution status of this line is deduced): offset_top = md->end_offset_top; | - |
1205 | eptr = md->end_match_ptr; never executed (the execution status of this line is deduced): eptr = md->end_match_ptr; | - |
1206 | ecode = md->start_code + code_offset; never executed (the execution status of this line is deduced): ecode = md->start_code + codelink; | - |
1207 | matched_once = TRUE; never executed (the execution status of this line is deduced): prev_is_word = 1; | - |
1208 | continue; never executed: continue; | 0 |
1209 | } | - |
1210 | | - |
1211 | /* See comment in the code for capturing groups above about handling | - |
1212 | THEN. */ | - |
1213 | | - |
1214 | if (rrc == MATCH_THEN) never evaluated: rrc == (-992) | 0 |
1215 | { | - |
1216 | next = ecode + GET(ecode,1); never executed (the execution status of this line is deduced): next = ecode + (ecode[1]); | - |
1217 | if (md->start_match_ptr < next && never evaluated: md->start_match_ptr < next | 0 |
1218 | (*ecode == OP_ALT || *next == OP_ALT)) never evaluated: *ecode == OP_ALT never evaluated: *next == OP_ALT | 0 |
1219 | rrc = MATCH_NOMATCH; | 0 |
1220 | } | 0 |
1221 | | - |
1222 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
1223 | ecode += GET(ecode, 1); never executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
1224 | if (*ecode != OP_ALT) break; never executed: break; never evaluated: *ecode != OP_ALT | 0 |
1225 | } | 0 |
1226 | | - |
1227 | if (matched_once || allow_zero) never evaluated: prev_is_word never evaluated: cur_is_word | 0 |
1228 | { | - |
1229 | ecode += 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1230 | break; | 0 |
1231 | } | - |
1232 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
1233 | | - |
1234 | /* Control never reaches here. */ | - |
1235 | | - |
1236 | /* Conditional group: compilation checked that there are no more than | - |
1237 | two branches. If the condition is false, skipping the first branch takes us | - |
1238 | past the end if there is only one branch, but that's OK because that is | - |
1239 | exactly what going to the ket would do. */ | - |
1240 | | - |
1241 | case OP_COND: | - |
1242 | case OP_SCOND: | - |
1243 | codelink = GET(ecode, 1); executed (the execution status of this line is deduced): codelink = (ecode[1]); | - |
1244 | | - |
1245 | /* Because of the way auto-callout works during compile, a callout item is | - |
1246 | inserted between OP_COND and an assertion condition. */ | - |
1247 | | - |
1248 | if (ecode[LINK_SIZE+1] == OP_CALLOUT) partially evaluated: ecode[1 +1] == OP_CALLOUT no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1249 | { | - |
1250 | if (PUBL(callout) != NULL) never evaluated: pcre16_callout != ((void *)0) | 0 |
1251 | { | - |
1252 | PUBL(callout_block) cb; never executed (the execution status of this line is deduced): pcre16_callout_block cb; | - |
1253 | cb.version = 2; /* Version 1 of the callout block */ never executed (the execution status of this line is deduced): cb.version = 2; | - |
1254 | cb.callout_number = ecode[LINK_SIZE+2]; never executed (the execution status of this line is deduced): cb.callout_number = ecode[1 +2]; | - |
1255 | cb.offset_vector = md->offset_vector; never executed (the execution status of this line is deduced): cb.offset_vector = md->offset_vector; | - |
1256 | #ifdef COMPILE_PCRE8 | - |
1257 | cb.subject = (PCRE_SPTR)md->start_subject; | - |
1258 | #else | - |
1259 | cb.subject = (PCRE_SPTR16)md->start_subject; never executed (the execution status of this line is deduced): cb.subject = (const unsigned short *)md->start_subject; | - |
1260 | #endif | - |
1261 | cb.subject_length = (int)(md->end_subject - md->start_subject); never executed (the execution status of this line is deduced): cb.subject_length = (int)(md->end_subject - md->start_subject); | - |
1262 | cb.start_match = (int)(mstart - md->start_subject); never executed (the execution status of this line is deduced): cb.start_match = (int)(mstart - md->start_subject); | - |
1263 | cb.current_position = (int)(eptr - md->start_subject); never executed (the execution status of this line is deduced): cb.current_position = (int)(eptr - md->start_subject); | - |
1264 | cb.pattern_position = GET(ecode, LINK_SIZE + 3); never executed (the execution status of this line is deduced): cb.pattern_position = (ecode[1 + 3]); | - |
1265 | cb.next_item_length = GET(ecode, 3 + 2*LINK_SIZE); never executed (the execution status of this line is deduced): cb.next_item_length = (ecode[3 + 2*1]); | - |
1266 | cb.capture_top = offset_top/2; never executed (the execution status of this line is deduced): cb.capture_top = offset_top/2; | - |
1267 | cb.capture_last = md->capture_last; never executed (the execution status of this line is deduced): cb.capture_last = md->capture_last; | - |
1268 | cb.callout_data = md->callout_data; never executed (the execution status of this line is deduced): cb.callout_data = md->callout_data; | - |
1269 | cb.mark = md->nomatch_mark; never executed (the execution status of this line is deduced): cb.mark = md->nomatch_mark; | - |
1270 | if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: (rrc = (*pcre16_callout)(&cb)) > 0 | 0 |
1271 | if (rrc < 0) RRETURN(rrc); never executed: return rrc; never evaluated: rrc < 0 | 0 |
1272 | } | 0 |
1273 | ecode += PRIV(OP_lengths)[OP_CALLOUT]; never executed (the execution status of this line is deduced): ecode += _pcre16_OP_lengths[OP_CALLOUT]; | - |
1274 | } | 0 |
1275 | | - |
1276 | condcode = ecode[LINK_SIZE+1]; never executed (the execution status of this line is deduced): condcode = ecode[1 +1]; | - |
1277 | | - |
1278 | /* Now see what the actual condition is */ | - |
1279 | | - |
1280 | if (condcode == OP_RREF || condcode == OP_NRREF) /* Recursion test */ partially evaluated: condcode == OP_RREF yes Evaluation Count:12 | no Evaluation Count:0 |
never evaluated: condcode == OP_NRREF | 0-12 |
1281 | { | - |
1282 | if (md->recursive == NULL) /* Not recursing => FALSE */ evaluated: md->recursive == ((void *)0) yes Evaluation Count:4 | yes Evaluation Count:8 |
| 4-8 |
1283 | { | - |
1284 | condition = FALSE; executed (the execution status of this line is deduced): condition = 0; | - |
1285 | ecode += GET(ecode, 1); executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
1286 | } executed: } Execution Count:4 | 4 |
1287 | else | - |
1288 | { | - |
1289 | int recno = GET2(ecode, LINK_SIZE + 2); /* Recursion group number*/ executed (the execution status of this line is deduced): int recno = ecode[1 + 2]; | - |
1290 | condition = (recno == RREF_ANY || recno == md->recursive->group_num); partially evaluated: recno == 0xffff yes Evaluation Count:8 | no Evaluation Count:0 |
never evaluated: recno == md->recursive->group_num | 0-8 |
1291 | | - |
1292 | /* If the test is for recursion into a specific subpattern, and it is | - |
1293 | false, but the test was set up by name, scan the table to see if the | - |
1294 | name refers to any other numbers, and test them. The condition is true | - |
1295 | if any one is set. */ | - |
1296 | | - |
1297 | if (!condition && condcode == OP_NRREF) partially evaluated: !condition no Evaluation Count:0 | yes Evaluation Count:8 |
never evaluated: condcode == OP_NRREF | 0-8 |
1298 | { | - |
1299 | pcre_uchar *slotA = md->name_table; never executed (the execution status of this line is deduced): pcre_uchar *slotA = md->name_table; | - |
1300 | for (i = 0; i < md->name_count; i++) never evaluated: i < md->name_count | 0 |
1301 | { | - |
1302 | if (GET2(slotA, 0) == recno) break; never executed: break; never evaluated: slotA[0] == recno | 0 |
1303 | slotA += md->name_entry_size; never executed (the execution status of this line is deduced): slotA += md->name_entry_size; | - |
1304 | } | 0 |
1305 | | - |
1306 | /* Found a name for the number - there can be only one; duplicate | - |
1307 | names for different numbers are allowed, but not vice versa. First | - |
1308 | scan down for duplicates. */ | - |
1309 | | - |
1310 | if (i < md->name_count) never evaluated: i < md->name_count | 0 |
1311 | { | - |
1312 | pcre_uchar *slotB = slotA; never executed (the execution status of this line is deduced): pcre_uchar *slotB = slotA; | - |
1313 | while (slotB > md->name_table) never evaluated: slotB > md->name_table | 0 |
1314 | { | - |
1315 | slotB -= md->name_entry_size; never executed (the execution status of this line is deduced): slotB -= md->name_entry_size; | - |
1316 | if (STRCMP_UC_UC(slotA + IMM2_SIZE, slotB + IMM2_SIZE) == 0) never evaluated: _pcre16_strcmp_uc_uc((slotA + 1), (slotB + 1)) == 0 | 0 |
1317 | { | - |
1318 | condition = GET2(slotB, 0) == md->recursive->group_num; never executed (the execution status of this line is deduced): condition = slotB[0] == md->recursive->group_num; | - |
1319 | if (condition) break; never executed: break; never evaluated: condition | 0 |
1320 | } | 0 |
1321 | else break; | 0 |
1322 | } | - |
1323 | | - |
1324 | /* Scan up for duplicates */ | - |
1325 | | - |
1326 | if (!condition) never evaluated: !condition | 0 |
1327 | { | - |
1328 | slotB = slotA; never executed (the execution status of this line is deduced): slotB = slotA; | - |
1329 | for (i++; i < md->name_count; i++) never evaluated: i < md->name_count | 0 |
1330 | { | - |
1331 | slotB += md->name_entry_size; never executed (the execution status of this line is deduced): slotB += md->name_entry_size; | - |
1332 | if (STRCMP_UC_UC(slotA + IMM2_SIZE, slotB + IMM2_SIZE) == 0) never evaluated: _pcre16_strcmp_uc_uc((slotA + 1), (slotB + 1)) == 0 | 0 |
1333 | { | - |
1334 | condition = GET2(slotB, 0) == md->recursive->group_num; never executed (the execution status of this line is deduced): condition = slotB[0] == md->recursive->group_num; | - |
1335 | if (condition) break; never executed: break; never evaluated: condition | 0 |
1336 | } | 0 |
1337 | else break; | 0 |
1338 | } | - |
1339 | } | 0 |
1340 | } | 0 |
1341 | } | 0 |
1342 | | - |
1343 | /* Chose branch according to the condition */ | - |
1344 | | - |
1345 | ecode += condition? 1 + IMM2_SIZE : GET(ecode, 1); partially evaluated: condition yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
1346 | } executed: } Execution Count:8 | 8 |
1347 | } | - |
1348 | | - |
1349 | else if (condcode == OP_CREF || condcode == OP_NCREF) /* Group used test */ never evaluated: condcode == OP_CREF never evaluated: condcode == OP_NCREF | 0 |
1350 | { | - |
1351 | offset = GET2(ecode, LINK_SIZE+2) << 1; /* Doubled ref number */ never executed (the execution status of this line is deduced): offset = ecode[1 +2] << 1; | - |
1352 | condition = offset < offset_top && md->offset_vector[offset] >= 0; never evaluated: offset < offset_top never evaluated: md->offset_vector[offset] >= 0 | 0 |
1353 | | - |
1354 | /* If the numbered capture is unset, but the reference was by name, | - |
1355 | scan the table to see if the name refers to any other numbers, and test | - |
1356 | them. The condition is true if any one is set. This is tediously similar | - |
1357 | to the code above, but not close enough to try to amalgamate. */ | - |
1358 | | - |
1359 | if (!condition && condcode == OP_NCREF) never evaluated: !condition never evaluated: condcode == OP_NCREF | 0 |
1360 | { | - |
1361 | int refno = offset >> 1; never executed (the execution status of this line is deduced): int refno = offset >> 1; | - |
1362 | pcre_uchar *slotA = md->name_table; never executed (the execution status of this line is deduced): pcre_uchar *slotA = md->name_table; | - |
1363 | | - |
1364 | for (i = 0; i < md->name_count; i++) never evaluated: i < md->name_count | 0 |
1365 | { | - |
1366 | if (GET2(slotA, 0) == refno) break; never executed: break; never evaluated: slotA[0] == refno | 0 |
1367 | slotA += md->name_entry_size; never executed (the execution status of this line is deduced): slotA += md->name_entry_size; | - |
1368 | } | 0 |
1369 | | - |
1370 | /* Found a name for the number - there can be only one; duplicate names | - |
1371 | for different numbers are allowed, but not vice versa. First scan down | - |
1372 | for duplicates. */ | - |
1373 | | - |
1374 | if (i < md->name_count) never evaluated: i < md->name_count | 0 |
1375 | { | - |
1376 | pcre_uchar *slotB = slotA; never executed (the execution status of this line is deduced): pcre_uchar *slotB = slotA; | - |
1377 | while (slotB > md->name_table) never evaluated: slotB > md->name_table | 0 |
1378 | { | - |
1379 | slotB -= md->name_entry_size; never executed (the execution status of this line is deduced): slotB -= md->name_entry_size; | - |
1380 | if (STRCMP_UC_UC(slotA + IMM2_SIZE, slotB + IMM2_SIZE) == 0) never evaluated: _pcre16_strcmp_uc_uc((slotA + 1), (slotB + 1)) == 0 | 0 |
1381 | { | - |
1382 | offset = GET2(slotB, 0) << 1; never executed (the execution status of this line is deduced): offset = slotB[0] << 1; | - |
1383 | condition = offset < offset_top && never evaluated: offset < offset_top | 0 |
1384 | md->offset_vector[offset] >= 0; never evaluated: md->offset_vector[offset] >= 0 | 0 |
1385 | if (condition) break; never executed: break; never evaluated: condition | 0 |
1386 | } | 0 |
1387 | else break; | 0 |
1388 | } | - |
1389 | | - |
1390 | /* Scan up for duplicates */ | - |
1391 | | - |
1392 | if (!condition) never evaluated: !condition | 0 |
1393 | { | - |
1394 | slotB = slotA; never executed (the execution status of this line is deduced): slotB = slotA; | - |
1395 | for (i++; i < md->name_count; i++) never evaluated: i < md->name_count | 0 |
1396 | { | - |
1397 | slotB += md->name_entry_size; never executed (the execution status of this line is deduced): slotB += md->name_entry_size; | - |
1398 | if (STRCMP_UC_UC(slotA + IMM2_SIZE, slotB + IMM2_SIZE) == 0) never evaluated: _pcre16_strcmp_uc_uc((slotA + 1), (slotB + 1)) == 0 | 0 |
1399 | { | - |
1400 | offset = GET2(slotB, 0) << 1; never executed (the execution status of this line is deduced): offset = slotB[0] << 1; | - |
1401 | condition = offset < offset_top && never evaluated: offset < offset_top | 0 |
1402 | md->offset_vector[offset] >= 0; never evaluated: md->offset_vector[offset] >= 0 | 0 |
1403 | if (condition) break; never executed: break; never evaluated: condition | 0 |
1404 | } | 0 |
1405 | else break; | 0 |
1406 | } | - |
1407 | } | 0 |
1408 | } | 0 |
1409 | } | 0 |
1410 | | - |
1411 | /* Chose branch according to the condition */ | - |
1412 | | - |
1413 | ecode += condition? 1 + IMM2_SIZE : GET(ecode, 1); never evaluated: condition | 0 |
1414 | } | 0 |
1415 | | - |
1416 | else if (condcode == OP_DEF) /* DEFINE - always false */ never evaluated: condcode == OP_DEF | 0 |
1417 | { | - |
1418 | condition = FALSE; never executed (the execution status of this line is deduced): condition = 0; | - |
1419 | ecode += GET(ecode, 1); never executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
1420 | } | 0 |
1421 | | - |
1422 | /* The condition is an assertion. Call match() to evaluate it - setting | - |
1423 | md->match_function_type to MATCH_CONDASSERT causes it to stop at the end of | - |
1424 | an assertion. */ | - |
1425 | | - |
1426 | else | - |
1427 | { | - |
1428 | md->match_function_type = MATCH_CONDASSERT; never executed (the execution status of this line is deduced): md->match_function_type = 1; | - |
1429 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM3); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,((void *)0),rdepth+1); | - |
1430 | if (rrc == MATCH_MATCH) never evaluated: rrc == 1 | 0 |
1431 | { | - |
1432 | if (md->end_offset_top > offset_top) never evaluated: md->end_offset_top > offset_top | 0 |
1433 | offset_top = md->end_offset_top; /* Captures may have happened */ never executed: offset_top = md->end_offset_top; | 0 |
1434 | condition = TRUE; never executed (the execution status of this line is deduced): condition = 1; | - |
1435 | ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE + 2); never executed (the execution status of this line is deduced): ecode += 1 + 1 + (ecode[1 + 2]); | - |
1436 | while (*ecode == OP_ALT) ecode += GET(ecode, 1); never executed: ecode += (ecode[1]); never evaluated: *ecode == OP_ALT | 0 |
1437 | } | 0 |
1438 | | - |
1439 | /* PCRE doesn't allow the effect of (*THEN) to escape beyond an | - |
1440 | assertion; it is therefore treated as NOMATCH. */ | - |
1441 | | - |
1442 | else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) never evaluated: rrc != 0 never evaluated: rrc != (-992) | 0 |
1443 | { | - |
1444 | RRETURN(rrc); /* Need braces because of following else */ never executed: return rrc; | 0 |
1445 | } | - |
1446 | else | - |
1447 | { | - |
1448 | condition = FALSE; never executed (the execution status of this line is deduced): condition = 0; | - |
1449 | ecode += codelink; never executed (the execution status of this line is deduced): ecode += codelink; | - |
1450 | } | 0 |
1451 | } | - |
1452 | | - |
1453 | /* We are now at the branch that is to be obeyed. As there is only one, can | - |
1454 | use tail recursion to avoid using another stack frame, except when there is | - |
1455 | unlimited repeat of a possibly empty group. In the latter case, a recursive | - |
1456 | call to match() is always required, unless the second alternative doesn't | - |
1457 | exist, in which case we can just plough on. Note that, for compatibility | - |
1458 | with Perl, the | in a conditional group is NOT treated as creating two | - |
1459 | alternatives. If a THEN is encountered in the branch, it propagates out to | - |
1460 | the enclosing alternative (unless nested in a deeper set of alternatives, | - |
1461 | of course). */ | - |
1462 | | - |
1463 | if (condition || *ecode == OP_ALT) evaluated: condition yes Evaluation Count:8 | yes Evaluation Count:4 |
partially evaluated: *ecode == OP_ALT yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-8 |
1464 | { | - |
1465 | if (op != OP_SCOND) partially evaluated: op != OP_SCOND yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
1466 | { | - |
1467 | ecode += 1 + LINK_SIZE; executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1468 | goto TAIL_RECURSE; executed: goto TAIL_RECURSE; Execution Count:12 | 12 |
1469 | } | - |
1470 | | - |
1471 | md->match_function_type = MATCH_CBEGROUP; never executed (the execution status of this line is deduced): md->match_function_type = 2; | - |
1472 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM49); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,eptrb,rdepth+1); | - |
1473 | RRETURN(rrc); never executed: return rrc; | 0 |
1474 | } | - |
1475 | | - |
1476 | /* Condition false & no alternative; continue after the group. */ | - |
1477 | | - |
1478 | else | - |
1479 | { | - |
1480 | ecode += 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1481 | } | 0 |
1482 | break; | 0 |
1483 | | - |
1484 | | - |
1485 | /* Before OP_ACCEPT there may be any number of OP_CLOSE opcodes, | - |
1486 | to close any currently open capturing brackets. */ | - |
1487 | | - |
1488 | case OP_CLOSE: | - |
1489 | number = GET2(ecode, 1); never executed (the execution status of this line is deduced): number = ecode[1]; | - |
1490 | offset = number << 1; never executed (the execution status of this line is deduced): offset = number << 1; | - |
1491 | | - |
1492 | #ifdef PCRE_DEBUG | - |
1493 | printf("end bracket %d at *ACCEPT", number); | - |
1494 | printf("\n"); | - |
1495 | #endif | - |
1496 | | - |
1497 | md->capture_last = number; never executed (the execution status of this line is deduced): md->capture_last = number; | - |
1498 | if (offset >= md->offset_max) md->offset_overflow = TRUE; else never executed: md->offset_overflow = 1; never evaluated: offset >= md->offset_max | 0 |
1499 | { | - |
1500 | md->offset_vector[offset] = never executed (the execution status of this line is deduced): md->offset_vector[offset] = | - |
1501 | md->offset_vector[md->offset_end - number]; never executed (the execution status of this line is deduced): md->offset_vector[md->offset_end - number]; | - |
1502 | md->offset_vector[offset+1] = (int)(eptr - md->start_subject); never executed (the execution status of this line is deduced): md->offset_vector[offset+1] = (int)(eptr - md->start_subject); | - |
1503 | if (offset_top <= offset) offset_top = offset + 2; never executed: offset_top = offset + 2; never evaluated: offset_top <= offset | 0 |
1504 | } | 0 |
1505 | ecode += 1 + IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1506 | break; | 0 |
1507 | | - |
1508 | | - |
1509 | /* End of the pattern, either real or forced. */ | - |
1510 | | - |
1511 | case OP_END: | - |
1512 | case OP_ACCEPT: | - |
1513 | case OP_ASSERT_ACCEPT: | - |
1514 | | - |
1515 | /* If we have matched an empty string, fail if not in an assertion and not | - |
1516 | in a recursion if either PCRE_NOTEMPTY is set, or if PCRE_NOTEMPTY_ATSTART | - |
1517 | is set and we have matched at the start of the subject. In both cases, | - |
1518 | backtracking will then try other alternatives, if any. */ | - |
1519 | | - |
1520 | if (eptr == mstart && op != OP_ASSERT_ACCEPT && evaluated: eptr == mstart yes Evaluation Count:174 | yes Evaluation Count:406 |
partially evaluated: op != OP_ASSERT_ACCEPT yes Evaluation Count:174 | no Evaluation Count:0 |
| 0-406 |
1521 | md->recursive == NULL && partially evaluated: md->recursive == ((void *)0) yes Evaluation Count:174 | no Evaluation Count:0 |
| 0-174 |
1522 | (md->notempty || partially evaluated: md->notempty no Evaluation Count:0 | yes Evaluation Count:174 |
| 0-174 |
1523 | (md->notempty_atstart && evaluated: md->notempty_atstart yes Evaluation Count:100 | yes Evaluation Count:74 |
| 74-100 |
1524 | mstart == md->start_subject + md->start_offset))) partially evaluated: mstart == md->start_subject + md->start_offset yes Evaluation Count:100 | no Evaluation Count:0 |
| 0-100 |
1525 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:100 | 100 |
1526 | | - |
1527 | /* Otherwise, we have a match. */ | - |
1528 | | - |
1529 | md->end_match_ptr = eptr; /* Record where we ended */ executed (the execution status of this line is deduced): md->end_match_ptr = eptr; | - |
1530 | md->end_offset_top = offset_top; /* and how many extracts were taken */ executed (the execution status of this line is deduced): md->end_offset_top = offset_top; | - |
1531 | md->start_match_ptr = mstart; /* and the start (\K can modify) */ executed (the execution status of this line is deduced): md->start_match_ptr = mstart; | - |
1532 | | - |
1533 | /* For some reason, the macros don't work properly if an expression is | - |
1534 | given as the argument to RRETURN when the heap is in use. */ | - |
1535 | | - |
1536 | rrc = (op == OP_END)? MATCH_MATCH : MATCH_ACCEPT; partially evaluated: (op == OP_END) yes Evaluation Count:480 | no Evaluation Count:0 |
| 0-480 |
1537 | RRETURN(rrc); executed: return rrc; Execution Count:480 | 480 |
1538 | | - |
1539 | /* Assertion brackets. Check the alternative branches in turn - the | - |
1540 | matching won't pass the KET for an assertion. If any one branch matches, | - |
1541 | the assertion is true. Lookbehind assertions have an OP_REVERSE item at the | - |
1542 | start of each branch to move the current point backwards, so the code at | - |
1543 | this level is identical to the lookahead case. When the assertion is part | - |
1544 | of a condition, we want to return immediately afterwards. The caller of | - |
1545 | this incarnation of the match() function will have set MATCH_CONDASSERT in | - |
1546 | md->match_function type, and one of these opcodes will be the first opcode | - |
1547 | that is processed. We use a local variable that is preserved over calls to | - |
1548 | match() to remember this case. */ | - |
1549 | | - |
1550 | case OP_ASSERT: | - |
1551 | case OP_ASSERTBACK: | - |
1552 | save_mark = md->mark; never executed (the execution status of this line is deduced): data = md->mark; | - |
1553 | if (md->match_function_type == MATCH_CONDASSERT) never evaluated: md->match_function_type == 1 | 0 |
1554 | { | - |
1555 | condassert = TRUE; never executed (the execution status of this line is deduced): condition = 1; | - |
1556 | md->match_function_type = 0; never executed (the execution status of this line is deduced): md->match_function_type = 0; | - |
1557 | } | 0 |
1558 | else condassert = FALSE; never executed: condition = 0; | 0 |
1559 | | - |
1560 | do | - |
1561 | { | - |
1562 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM4); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,((void *)0),rdepth+1); | - |
1563 | if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) never evaluated: rrc == 1 never evaluated: rrc == (-999) | 0 |
1564 | { | - |
1565 | mstart = md->start_match_ptr; /* In case \K reset it */ never executed (the execution status of this line is deduced): mstart = md->start_match_ptr; | - |
1566 | break; | 0 |
1567 | } | - |
1568 | | - |
1569 | /* PCRE does not allow THEN to escape beyond an assertion; it is treated | - |
1570 | as NOMATCH. */ | - |
1571 | | - |
1572 | if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 never evaluated: rrc != (-992) | 0 |
1573 | ecode += GET(ecode, 1); never executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
1574 | md->mark = save_mark; never executed (the execution status of this line is deduced): md->mark = data; | - |
1575 | } | 0 |
1576 | while (*ecode == OP_ALT); never evaluated: *ecode == OP_ALT | 0 |
1577 | | - |
1578 | if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: *ecode == OP_KET | 0 |
1579 | | - |
1580 | /* If checking an assertion for a condition, return MATCH_MATCH. */ | - |
1581 | | - |
1582 | if (condassert) RRETURN(MATCH_MATCH); never executed: return 1; never evaluated: condition | 0 |
1583 | | - |
1584 | /* Continue from after the assertion, updating the offsets high water | - |
1585 | mark, since extracts may have been taken during the assertion. */ | - |
1586 | | - |
1587 | do ecode += GET(ecode,1); while (*ecode == OP_ALT); never executed: ecode += (ecode[1]); never evaluated: *ecode == OP_ALT | 0 |
1588 | ecode += 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1589 | offset_top = md->end_offset_top; never executed (the execution status of this line is deduced): offset_top = md->end_offset_top; | - |
1590 | continue; never executed: continue; | 0 |
1591 | | - |
1592 | /* Negative assertion: all branches must fail to match. Encountering SKIP, | - |
1593 | PRUNE, or COMMIT means we must assume failure without checking subsequent | - |
1594 | branches. */ | - |
1595 | | - |
1596 | case OP_ASSERT_NOT: | - |
1597 | case OP_ASSERTBACK_NOT: | - |
1598 | save_mark = md->mark; never executed (the execution status of this line is deduced): data = md->mark; | - |
1599 | if (md->match_function_type == MATCH_CONDASSERT) never evaluated: md->match_function_type == 1 | 0 |
1600 | { | - |
1601 | condassert = TRUE; never executed (the execution status of this line is deduced): condition = 1; | - |
1602 | md->match_function_type = 0; never executed (the execution status of this line is deduced): md->match_function_type = 0; | - |
1603 | } | 0 |
1604 | else condassert = FALSE; never executed: condition = 0; | 0 |
1605 | | - |
1606 | do | - |
1607 | { | - |
1608 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, NULL, RM5); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,((void *)0),rdepth+1); | - |
1609 | md->mark = save_mark; never executed (the execution status of this line is deduced): md->mark = data; | - |
1610 | if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: rrc == 1 never evaluated: rrc == (-999) | 0 |
1611 | if (rrc == MATCH_SKIP || rrc == MATCH_PRUNE || rrc == MATCH_COMMIT) never evaluated: rrc == (-994) never evaluated: rrc == (-995) never evaluated: rrc == (-998) | 0 |
1612 | { | - |
1613 | do ecode += GET(ecode,1); while (*ecode == OP_ALT); never executed: ecode += (ecode[1]); never evaluated: *ecode == OP_ALT | 0 |
1614 | break; | 0 |
1615 | } | - |
1616 | | - |
1617 | /* PCRE does not allow THEN to escape beyond an assertion; it is treated | - |
1618 | as NOMATCH. */ | - |
1619 | | - |
1620 | if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 never evaluated: rrc != (-992) | 0 |
1621 | ecode += GET(ecode,1); never executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
1622 | } | 0 |
1623 | while (*ecode == OP_ALT); never evaluated: *ecode == OP_ALT | 0 |
1624 | | - |
1625 | if (condassert) RRETURN(MATCH_MATCH); /* Condition assertion */ never executed: return 1; never evaluated: condition | 0 |
1626 | | - |
1627 | ecode += 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1628 | continue; never executed: continue; | 0 |
1629 | | - |
1630 | /* Move the subject pointer back. This occurs only at the start of | - |
1631 | each branch of a lookbehind assertion. If we are too close to the start to | - |
1632 | move back, this match function fails. When working with UTF-8 we move | - |
1633 | back a number of characters, not bytes. */ | - |
1634 | | - |
1635 | case OP_REVERSE: | - |
1636 | #ifdef SUPPORT_UTF | - |
1637 | if (utf) | 0 |
1638 | { | - |
1639 | i = GET(ecode, 1); never executed (the execution status of this line is deduced): i = (ecode[1]); | - |
1640 | while (i-- > 0) | 0 |
1641 | { | - |
1642 | eptr--; never executed (the execution status of this line is deduced): eptr--; | - |
1643 | if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: eptr < md->start_subject | 0 |
1644 | BACKCHAR(eptr); never executed: eptr--; never evaluated: (*eptr & 0xfc00) == 0xdc00 | 0 |
1645 | } | 0 |
1646 | } | 0 |
1647 | else | - |
1648 | #endif | - |
1649 | | - |
1650 | /* No UTF-8 support, or not in UTF-8 mode: count is byte count */ | - |
1651 | | - |
1652 | { | - |
1653 | eptr -= GET(ecode, 1); never executed (the execution status of this line is deduced): eptr -= (ecode[1]); | - |
1654 | if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: eptr < md->start_subject | 0 |
1655 | } | 0 |
1656 | | - |
1657 | /* Save the earliest consulted character, then skip to next op code */ | - |
1658 | | - |
1659 | if (eptr < md->start_used_ptr) md->start_used_ptr = eptr; never executed: md->start_used_ptr = eptr; never evaluated: eptr < md->start_used_ptr | 0 |
1660 | ecode += 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1661 | break; | 0 |
1662 | | - |
1663 | /* The callout item calls an external function, if one is provided, passing | - |
1664 | details of the match so far. This is mainly for debugging, though the | - |
1665 | function is able to force a failure. */ | - |
1666 | | - |
1667 | case OP_CALLOUT: | - |
1668 | if (PUBL(callout) != NULL) never evaluated: pcre16_callout != ((void *)0) | 0 |
1669 | { | - |
1670 | PUBL(callout_block) cb; never executed (the execution status of this line is deduced): pcre16_callout_block cb; | - |
1671 | cb.version = 2; /* Version 1 of the callout block */ never executed (the execution status of this line is deduced): cb.version = 2; | - |
1672 | cb.callout_number = ecode[1]; never executed (the execution status of this line is deduced): cb.callout_number = ecode[1]; | - |
1673 | cb.offset_vector = md->offset_vector; never executed (the execution status of this line is deduced): cb.offset_vector = md->offset_vector; | - |
1674 | #ifdef COMPILE_PCRE8 | - |
1675 | cb.subject = (PCRE_SPTR)md->start_subject; | - |
1676 | #else | - |
1677 | cb.subject = (PCRE_SPTR16)md->start_subject; never executed (the execution status of this line is deduced): cb.subject = (const unsigned short *)md->start_subject; | - |
1678 | #endif | - |
1679 | cb.subject_length = (int)(md->end_subject - md->start_subject); never executed (the execution status of this line is deduced): cb.subject_length = (int)(md->end_subject - md->start_subject); | - |
1680 | cb.start_match = (int)(mstart - md->start_subject); never executed (the execution status of this line is deduced): cb.start_match = (int)(mstart - md->start_subject); | - |
1681 | cb.current_position = (int)(eptr - md->start_subject); never executed (the execution status of this line is deduced): cb.current_position = (int)(eptr - md->start_subject); | - |
1682 | cb.pattern_position = GET(ecode, 2); never executed (the execution status of this line is deduced): cb.pattern_position = (ecode[2]); | - |
1683 | cb.next_item_length = GET(ecode, 2 + LINK_SIZE); never executed (the execution status of this line is deduced): cb.next_item_length = (ecode[2 + 1]); | - |
1684 | cb.capture_top = offset_top/2; never executed (the execution status of this line is deduced): cb.capture_top = offset_top/2; | - |
1685 | cb.capture_last = md->capture_last; never executed (the execution status of this line is deduced): cb.capture_last = md->capture_last; | - |
1686 | cb.callout_data = md->callout_data; never executed (the execution status of this line is deduced): cb.callout_data = md->callout_data; | - |
1687 | cb.mark = md->nomatch_mark; never executed (the execution status of this line is deduced): cb.mark = md->nomatch_mark; | - |
1688 | if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: (rrc = (*pcre16_callout)(&cb)) > 0 | 0 |
1689 | if (rrc < 0) RRETURN(rrc); never executed: return rrc; never evaluated: rrc < 0 | 0 |
1690 | } | 0 |
1691 | ecode += 2 + 2*LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 2 + 2*1; | - |
1692 | break; | 0 |
1693 | | - |
1694 | /* Recursion either matches the current regex, or some subexpression. The | - |
1695 | offset data is the offset to the starting bracket from the start of the | - |
1696 | whole pattern. (This is so that it works from duplicated subpatterns.) | - |
1697 | | - |
1698 | The state of the capturing groups is preserved over recursion, and | - |
1699 | re-instated afterwards. We don't know how many are started and not yet | - |
1700 | finished (offset_top records the completed total) so we just have to save | - |
1701 | all the potential data. There may be up to 65535 such values, which is too | - |
1702 | large to put on the stack, but using malloc for small numbers seems | - |
1703 | expensive. As a compromise, the stack is used when there are no more than | - |
1704 | REC_STACK_SAVE_MAX values to store; otherwise malloc is used. | - |
1705 | | - |
1706 | There are also other values that have to be saved. We use a chained | - |
1707 | sequence of blocks that actually live on the stack. Thanks to Robin Houston | - |
1708 | for the original version of this logic. It has, however, been hacked around | - |
1709 | a lot, so he is not to blame for the current way it works. */ | - |
1710 | | - |
1711 | case OP_RECURSE: | - |
1712 | { | - |
1713 | recursion_info *ri; executed (the execution status of this line is deduced): recursion_info *ri; | - |
1714 | int recno; executed (the execution status of this line is deduced): int recno; | - |
1715 | | - |
1716 | callpat = md->start_code + GET(ecode, 1); executed (the execution status of this line is deduced): callpat = md->start_code + (ecode[1]); | - |
1717 | recno = (callpat == md->start_code)? 0 : evaluated: (callpat == md->start_code) yes Evaluation Count:8 | yes Evaluation Count:8 |
| 8 |
1718 | GET2(callpat, 1 + LINK_SIZE); executed (the execution status of this line is deduced): callpat[1 + 1]; | - |
1719 | | - |
1720 | /* Check for repeating a recursion without advancing the subject pointer. | - |
1721 | This should catch convoluted mutual recursions. (Some simple cases are | - |
1722 | caught at compile time.) */ | - |
1723 | | - |
1724 | for (ri = md->recursive; ri != NULL; ri = ri->prevrec) evaluated: ri != ((void *)0) yes Evaluation Count:20 | yes Evaluation Count:12 |
| 12-20 |
1725 | if (recno == ri->group_num && eptr == ri->subject_position) evaluated: recno == ri->group_num yes Evaluation Count:8 | yes Evaluation Count:12 |
evaluated: eptr == ri->subject_position yes Evaluation Count:4 | yes Evaluation Count:4 |
| 4-12 |
1726 | RRETURN(PCRE_ERROR_RECURSELOOP); executed: return (-26); Execution Count:4 | 4 |
1727 | | - |
1728 | /* Add to "recursing stack" */ | - |
1729 | | - |
1730 | new_recursive.group_num = recno; executed (the execution status of this line is deduced): new_recursive.group_num = recno; | - |
1731 | new_recursive.subject_position = eptr; executed (the execution status of this line is deduced): new_recursive.subject_position = eptr; | - |
1732 | new_recursive.prevrec = md->recursive; executed (the execution status of this line is deduced): new_recursive.prevrec = md->recursive; | - |
1733 | md->recursive = &new_recursive; executed (the execution status of this line is deduced): md->recursive = &new_recursive; | - |
1734 | | - |
1735 | /* Where to continue from afterwards */ | - |
1736 | | - |
1737 | ecode += 1 + LINK_SIZE; executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1738 | | - |
1739 | /* Now save the offset data */ | - |
1740 | | - |
1741 | new_recursive.saved_max = md->offset_end; executed (the execution status of this line is deduced): new_recursive.saved_max = md->offset_end; | - |
1742 | if (new_recursive.saved_max <= REC_STACK_SAVE_MAX) partially evaluated: new_recursive.saved_max <= 30 yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
1743 | new_recursive.offset_save = stacksave; executed: new_recursive.offset_save = stacksave; Execution Count:12 | 12 |
1744 | else | - |
1745 | { | - |
1746 | new_recursive.offset_save = never executed (the execution status of this line is deduced): new_recursive.offset_save = | - |
1747 | (int *)(PUBL(malloc))(new_recursive.saved_max * sizeof(int)); never executed (the execution status of this line is deduced): (int *)(pcre16_malloc)(new_recursive.saved_max * sizeof(int)); | - |
1748 | if (new_recursive.offset_save == NULL) RRETURN(PCRE_ERROR_NOMEMORY); never executed: return (-6); never evaluated: new_recursive.offset_save == ((void *)0) | 0 |
1749 | } | 0 |
1750 | memcpy(new_recursive.offset_save, md->offset_vector, executed (the execution status of this line is deduced): memcpy(new_recursive.offset_save, md->offset_vector, | - |
1751 | new_recursive.saved_max * sizeof(int)); executed (the execution status of this line is deduced): new_recursive.saved_max * sizeof(int)); | - |
1752 | | - |
1753 | /* OK, now we can do the recursion. After processing each alternative, | - |
1754 | restore the offset data. If there were nested recursions, md->recursive | - |
1755 | might be changed, so reset it before looping. */ | - |
1756 | | - |
1757 | DPRINTF(("Recursing into group %d\n", new_recursive.group_num)); | - |
1758 | cbegroup = (*callpat >= OP_SBRA); executed (the execution status of this line is deduced): condition = (*callpat >= OP_SBRA); | - |
1759 | do | - |
1760 | { | - |
1761 | if (cbegroup) md->match_function_type = MATCH_CBEGROUP; never executed: md->match_function_type = 2; partially evaluated: condition no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1762 | RMATCH(eptr, callpat + PRIV(OP_lengths)[*callpat], offset_top, executed (the execution status of this line is deduced): rrc = match(eptr,callpat + _pcre16_OP_lengths[*callpat],mstart,offset_top,md,eptrb,rdepth+1); | - |
1763 | md, eptrb, RM6); | - |
1764 | memcpy(md->offset_vector, new_recursive.offset_save, executed (the execution status of this line is deduced): memcpy(md->offset_vector, new_recursive.offset_save, | - |
1765 | new_recursive.saved_max * sizeof(int)); executed (the execution status of this line is deduced): new_recursive.saved_max * sizeof(int)); | - |
1766 | md->recursive = new_recursive.prevrec; executed (the execution status of this line is deduced): md->recursive = new_recursive.prevrec; | - |
1767 | if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) partially evaluated: rrc == 1 no Evaluation Count:0 | yes Evaluation Count:12 |
partially evaluated: rrc == (-999) no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1768 | { | - |
1769 | DPRINTF(("Recursion matched\n")); | - |
1770 | if (new_recursive.offset_save != stacksave) never evaluated: new_recursive.offset_save != stacksave | 0 |
1771 | (PUBL(free))(new_recursive.offset_save); never executed: (pcre16_free)(new_recursive.offset_save); | 0 |
1772 | | - |
1773 | /* Set where we got to in the subject, and reset the start in case | - |
1774 | it was changed by \K. This *is* propagated back out of a recursion, | - |
1775 | for Perl compatibility. */ | - |
1776 | | - |
1777 | eptr = md->end_match_ptr; never executed (the execution status of this line is deduced): eptr = md->end_match_ptr; | - |
1778 | mstart = md->start_match_ptr; never executed (the execution status of this line is deduced): mstart = md->start_match_ptr; | - |
1779 | goto RECURSION_MATCHED; /* Exit loop; end processing */ never executed: goto RECURSION_MATCHED; | 0 |
1780 | } | - |
1781 | | - |
1782 | /* PCRE does not allow THEN to escape beyond a recursion; it is treated | - |
1783 | as NOMATCH. */ | - |
1784 | | - |
1785 | else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) partially evaluated: rrc != 0 yes Evaluation Count:12 | no Evaluation Count:0 |
partially evaluated: rrc != (-992) yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
1786 | { | - |
1787 | DPRINTF(("Recursion gave error %d\n", rrc)); | - |
1788 | if (new_recursive.offset_save != stacksave) partially evaluated: new_recursive.offset_save != stacksave no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1789 | (PUBL(free))(new_recursive.offset_save); never executed: (pcre16_free)(new_recursive.offset_save); | 0 |
1790 | RRETURN(rrc); executed: return rrc; Execution Count:12 | 12 |
1791 | } | - |
1792 | | - |
1793 | md->recursive = &new_recursive; never executed (the execution status of this line is deduced): md->recursive = &new_recursive; | - |
1794 | callpat += GET(callpat, 1); never executed (the execution status of this line is deduced): callpat += (callpat[1]); | - |
1795 | } | 0 |
1796 | while (*callpat == OP_ALT); never evaluated: *callpat == OP_ALT | 0 |
1797 | | - |
1798 | DPRINTF(("Recursion didn't match\n")); | - |
1799 | md->recursive = new_recursive.prevrec; never executed (the execution status of this line is deduced): md->recursive = new_recursive.prevrec; | - |
1800 | if (new_recursive.offset_save != stacksave) never evaluated: new_recursive.offset_save != stacksave | 0 |
1801 | (PUBL(free))(new_recursive.offset_save); never executed: (pcre16_free)(new_recursive.offset_save); | 0 |
1802 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
1803 | } | - |
1804 | | - |
1805 | RECURSION_MATCHED: | - |
1806 | break; | 0 |
1807 | | - |
1808 | /* An alternation is the end of a branch; scan along to find the end of the | - |
1809 | bracketed group and go to there. */ | - |
1810 | | - |
1811 | case OP_ALT: | - |
1812 | do ecode += GET(ecode,1); while (*ecode == OP_ALT); executed: ecode += (ecode[1]); Execution Count:15 partially evaluated: *ecode == OP_ALT no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
1813 | break; executed: break; Execution Count:15 | 15 |
1814 | | - |
1815 | /* BRAZERO, BRAMINZERO and SKIPZERO occur just before a bracket group, | - |
1816 | indicating that it may occur zero times. It may repeat infinitely, or not | - |
1817 | at all - i.e. it could be ()* or ()? or even (){0} in the pattern. Brackets | - |
1818 | with fixed upper repeat limits are compiled as a number of copies, with the | - |
1819 | optional ones preceded by BRAZERO or BRAMINZERO. */ | - |
1820 | | - |
1821 | case OP_BRAZERO: | - |
1822 | next = ecode + 1; executed (the execution status of this line is deduced): next = ecode + 1; | - |
1823 | RMATCH(eptr, next, offset_top, md, eptrb, RM10); executed (the execution status of this line is deduced): rrc = match(eptr,next,mstart,offset_top,md,eptrb,rdepth+1); | - |
1824 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:2 evaluated: rrc != 0 yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
1825 | do next += GET(next, 1); while (*next == OP_ALT); executed: next += (next[1]); Execution Count:1 partially evaluated: *next == OP_ALT no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1826 | ecode = next + 1 + LINK_SIZE; executed (the execution status of this line is deduced): ecode = next + 1 + 1; | - |
1827 | break; executed: break; Execution Count:1 | 1 |
1828 | | - |
1829 | case OP_BRAMINZERO: | - |
1830 | next = ecode + 1; executed (the execution status of this line is deduced): next = ecode + 1; | - |
1831 | do next += GET(next, 1); while (*next == OP_ALT); executed: next += (next[1]); Execution Count:14 partially evaluated: *next == OP_ALT no Evaluation Count:0 | yes Evaluation Count:14 |
| 0-14 |
1832 | RMATCH(eptr, next + 1+LINK_SIZE, offset_top, md, eptrb, RM11); executed (the execution status of this line is deduced): rrc = match(eptr,next + 1+1,mstart,offset_top,md,eptrb,rdepth+1); | - |
1833 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:8 evaluated: rrc != 0 yes Evaluation Count:8 | yes Evaluation Count:6 |
| 6-8 |
1834 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
1835 | break; executed: break; Execution Count:6 | 6 |
1836 | | - |
1837 | case OP_SKIPZERO: | - |
1838 | next = ecode+1; never executed (the execution status of this line is deduced): next = ecode+1; | - |
1839 | do next += GET(next,1); while (*next == OP_ALT); never executed: next += (next[1]); never evaluated: *next == OP_ALT | 0 |
1840 | ecode = next + 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode = next + 1 + 1; | - |
1841 | break; | 0 |
1842 | | - |
1843 | /* BRAPOSZERO occurs before a possessive bracket group. Don't do anything | - |
1844 | here; just jump to the group, with allow_zero set TRUE. */ | - |
1845 | | - |
1846 | case OP_BRAPOSZERO: | - |
1847 | op = *(++ecode); never executed (the execution status of this line is deduced): op = *(++ecode); | - |
1848 | allow_zero = TRUE; never executed (the execution status of this line is deduced): cur_is_word = 1; | - |
1849 | if (op == OP_CBRAPOS || op == OP_SCBRAPOS) goto POSSESSIVE_CAPTURE; never executed: goto POSSESSIVE_CAPTURE; never evaluated: op == OP_CBRAPOS never evaluated: op == OP_SCBRAPOS | 0 |
1850 | goto POSSESSIVE_NON_CAPTURE; never executed: goto POSSESSIVE_NON_CAPTURE; | 0 |
1851 | | - |
1852 | /* End of a group, repeated or non-repeating. */ | - |
1853 | | - |
1854 | case OP_KET: | - |
1855 | case OP_KETRMIN: | - |
1856 | case OP_KETRMAX: | - |
1857 | case OP_KETRPOS: | - |
1858 | prev = ecode - GET(ecode, 1); executed (the execution status of this line is deduced): prev = ecode - (ecode[1]); | - |
1859 | | - |
1860 | /* If this was a group that remembered the subject start, in order to break | - |
1861 | infinite repeats of empty string matches, retrieve the subject start from | - |
1862 | the chain. Otherwise, set it NULL. */ | - |
1863 | | - |
1864 | if (*prev >= OP_SBRA || *prev == OP_ONCE) partially evaluated: *prev >= OP_SBRA no Evaluation Count:0 | yes Evaluation Count:784 |
partially evaluated: *prev == OP_ONCE no Evaluation Count:0 | yes Evaluation Count:784 |
| 0-784 |
1865 | { | - |
1866 | saved_eptr = eptrb->epb_saved_eptr; /* Value at start of group */ never executed (the execution status of this line is deduced): saved_eptr = eptrb->epb_saved_eptr; | - |
1867 | eptrb = eptrb->epb_prev; /* Backup to previous group */ never executed (the execution status of this line is deduced): eptrb = eptrb->epb_prev; | - |
1868 | } | 0 |
1869 | else saved_eptr = NULL; executed: saved_eptr = ((void *)0); Execution Count:784 | 784 |
1870 | | - |
1871 | /* If we are at the end of an assertion group or a non-capturing atomic | - |
1872 | group, stop matching and return MATCH_MATCH, but record the current high | - |
1873 | water mark for use by positive assertions. We also need to record the match | - |
1874 | start in case it was changed by \K. */ | - |
1875 | | - |
1876 | if ((*prev >= OP_ASSERT && *prev <= OP_ASSERTBACK_NOT) || partially evaluated: *prev >= OP_ASSERT yes Evaluation Count:784 | no Evaluation Count:0 |
partially evaluated: *prev <= OP_ASSERTBACK_NOT no Evaluation Count:0 | yes Evaluation Count:784 |
| 0-784 |
1877 | *prev == OP_ONCE_NC) partially evaluated: *prev == OP_ONCE_NC no Evaluation Count:0 | yes Evaluation Count:784 |
| 0-784 |
1878 | { | - |
1879 | md->end_match_ptr = eptr; /* For ONCE_NC */ never executed (the execution status of this line is deduced): md->end_match_ptr = eptr; | - |
1880 | md->end_offset_top = offset_top; never executed (the execution status of this line is deduced): md->end_offset_top = offset_top; | - |
1881 | md->start_match_ptr = mstart; never executed (the execution status of this line is deduced): md->start_match_ptr = mstart; | - |
1882 | RRETURN(MATCH_MATCH); /* Sets md->mark */ never executed: return 1; | 0 |
1883 | } | - |
1884 | | - |
1885 | /* For capturing groups we have to check the group number back at the start | - |
1886 | and if necessary complete handling an extraction by setting the offsets and | - |
1887 | bumping the high water mark. Whole-pattern recursion is coded as a recurse | - |
1888 | into group 0, so it won't be picked up here. Instead, we catch it when the | - |
1889 | OP_END is reached. Other recursion is handled here. We just have to record | - |
1890 | the current subject position and start match pointer and give a MATCH | - |
1891 | return. */ | - |
1892 | | - |
1893 | if (*prev == OP_CBRA || *prev == OP_SCBRA || evaluated: *prev == OP_CBRA yes Evaluation Count:174 | yes Evaluation Count:610 |
partially evaluated: *prev == OP_SCBRA no Evaluation Count:0 | yes Evaluation Count:610 |
| 0-610 |
1894 | *prev == OP_CBRAPOS || *prev == OP_SCBRAPOS) partially evaluated: *prev == OP_CBRAPOS no Evaluation Count:0 | yes Evaluation Count:610 |
partially evaluated: *prev == OP_SCBRAPOS no Evaluation Count:0 | yes Evaluation Count:610 |
| 0-610 |
1895 | { | - |
1896 | number = GET2(prev, 1+LINK_SIZE); executed (the execution status of this line is deduced): number = prev[1+1]; | - |
1897 | offset = number << 1; executed (the execution status of this line is deduced): offset = number << 1; | - |
1898 | | - |
1899 | #ifdef PCRE_DEBUG | - |
1900 | printf("end bracket %d", number); | - |
1901 | printf("\n"); | - |
1902 | #endif | - |
1903 | | - |
1904 | /* Handle a recursively called group. */ | - |
1905 | | - |
1906 | if (md->recursive != NULL && md->recursive->group_num == number) partially evaluated: md->recursive != ((void *)0) no Evaluation Count:0 | yes Evaluation Count:174 |
never evaluated: md->recursive->group_num == number | 0-174 |
1907 | { | - |
1908 | md->end_match_ptr = eptr; never executed (the execution status of this line is deduced): md->end_match_ptr = eptr; | - |
1909 | md->start_match_ptr = mstart; never executed (the execution status of this line is deduced): md->start_match_ptr = mstart; | - |
1910 | RRETURN(MATCH_MATCH); never executed: return 1; | 0 |
1911 | } | - |
1912 | | - |
1913 | /* Deal with capturing */ | - |
1914 | | - |
1915 | md->capture_last = number; executed (the execution status of this line is deduced): md->capture_last = number; | - |
1916 | if (offset >= md->offset_max) md->offset_overflow = TRUE; else never executed: md->offset_overflow = 1; partially evaluated: offset >= md->offset_max no Evaluation Count:0 | yes Evaluation Count:174 |
| 0-174 |
1917 | { | - |
1918 | /* If offset is greater than offset_top, it means that we are | - |
1919 | "skipping" a capturing group, and that group's offsets must be marked | - |
1920 | unset. In earlier versions of PCRE, all the offsets were unset at the | - |
1921 | start of matching, but this doesn't work because atomic groups and | - |
1922 | assertions can cause a value to be set that should later be unset. | - |
1923 | Example: matching /(?>(a))b|(a)c/ against "ac". This sets group 1 as | - |
1924 | part of the atomic group, but this is not on the final matching path, | - |
1925 | so must be unset when 2 is set. (If there is no group 2, there is no | - |
1926 | problem, because offset_top will then be 2, indicating no capture.) */ | - |
1927 | | - |
1928 | if (offset > offset_top) evaluated: offset > offset_top yes Evaluation Count:5 | yes Evaluation Count:169 |
| 5-169 |
1929 | { | - |
1930 | register int *iptr = md->offset_vector + offset_top; executed (the execution status of this line is deduced): register int *iptr = md->offset_vector + offset_top; | - |
1931 | register int *iend = md->offset_vector + offset; executed (the execution status of this line is deduced): register int *iend = md->offset_vector + offset; | - |
1932 | while (iptr < iend) *iptr++ = -1; executed: *iptr++ = -1; Execution Count:106 evaluated: iptr < iend yes Evaluation Count:106 | yes Evaluation Count:5 |
| 5-106 |
1933 | } executed: } Execution Count:5 | 5 |
1934 | | - |
1935 | /* Now make the extraction */ | - |
1936 | | - |
1937 | md->offset_vector[offset] = executed (the execution status of this line is deduced): md->offset_vector[offset] = | - |
1938 | md->offset_vector[md->offset_end - number]; executed (the execution status of this line is deduced): md->offset_vector[md->offset_end - number]; | - |
1939 | md->offset_vector[offset+1] = (int)(eptr - md->start_subject); executed (the execution status of this line is deduced): md->offset_vector[offset+1] = (int)(eptr - md->start_subject); | - |
1940 | if (offset_top <= offset) offset_top = offset + 2; executed: offset_top = offset + 2; Execution Count:122 evaluated: offset_top <= offset yes Evaluation Count:122 | yes Evaluation Count:52 |
| 52-122 |
1941 | } executed: } Execution Count:174 | 174 |
1942 | } | - |
1943 | | - |
1944 | /* For an ordinary non-repeating ket, just continue at this level. This | - |
1945 | also happens for a repeating ket if no characters were matched in the | - |
1946 | group. This is the forcible breaking of infinite loops as implemented in | - |
1947 | Perl 5.005. For a non-repeating atomic group that includes captures, | - |
1948 | establish a backup point by processing the rest of the pattern at a lower | - |
1949 | level. If this results in a NOMATCH return, pass MATCH_ONCE back to the | - |
1950 | original OP_ONCE level, thereby bypassing intermediate backup points, but | - |
1951 | resetting any captures that happened along the way. */ | - |
1952 | | - |
1953 | if (*ecode == OP_KET || eptr == saved_eptr) evaluated: *ecode == OP_KET yes Evaluation Count:765 | yes Evaluation Count:19 |
partially evaluated: eptr == saved_eptr no Evaluation Count:0 | yes Evaluation Count:19 |
| 0-765 |
1954 | { | - |
1955 | if (*prev == OP_ONCE) partially evaluated: *prev == OP_ONCE no Evaluation Count:0 | yes Evaluation Count:765 |
| 0-765 |
1956 | { | - |
1957 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM12); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,eptrb,rdepth+1); | - |
1958 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
1959 | md->once_target = prev; /* Level at which to change to MATCH_NOMATCH */ never executed (the execution status of this line is deduced): md->once_target = prev; | - |
1960 | RRETURN(MATCH_ONCE); never executed: return (-996); | 0 |
1961 | } | - |
1962 | ecode += 1 + LINK_SIZE; /* Carry on at this level */ executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
1963 | break; executed: break; Execution Count:765 | 765 |
1964 | } | - |
1965 | | - |
1966 | /* OP_KETRPOS is a possessive repeating ket. Remember the current position, | - |
1967 | and return the MATCH_KETRPOS. This makes it possible to do the repeats one | - |
1968 | at a time from the outer level, thus saving stack. */ | - |
1969 | | - |
1970 | if (*ecode == OP_KETRPOS) partially evaluated: *ecode == OP_KETRPOS no Evaluation Count:0 | yes Evaluation Count:19 |
| 0-19 |
1971 | { | - |
1972 | md->end_match_ptr = eptr; never executed (the execution status of this line is deduced): md->end_match_ptr = eptr; | - |
1973 | md->end_offset_top = offset_top; never executed (the execution status of this line is deduced): md->end_offset_top = offset_top; | - |
1974 | RRETURN(MATCH_KETRPOS); never executed: return (-997); | 0 |
1975 | } | - |
1976 | | - |
1977 | /* The normal repeating kets try the rest of the pattern or restart from | - |
1978 | the preceding bracket, in the appropriate order. In the second case, we can | - |
1979 | use tail recursion to avoid using another stack frame, unless we have an | - |
1980 | an atomic group or an unlimited repeat of a group that can match an empty | - |
1981 | string. */ | - |
1982 | | - |
1983 | if (*ecode == OP_KETRMIN) evaluated: *ecode == OP_KETRMIN yes Evaluation Count:18 | yes Evaluation Count:1 |
| 1-18 |
1984 | { | - |
1985 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM7); executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,eptrb,rdepth+1); | - |
1986 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:6 evaluated: rrc != 0 yes Evaluation Count:6 | yes Evaluation Count:12 |
| 6-12 |
1987 | if (*prev == OP_ONCE) partially evaluated: *prev == OP_ONCE no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1988 | { | - |
1989 | RMATCH(eptr, prev, offset_top, md, eptrb, RM8); never executed (the execution status of this line is deduced): rrc = match(eptr,prev,mstart,offset_top,md,eptrb,rdepth+1); | - |
1990 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
1991 | md->once_target = prev; /* Level at which to change to MATCH_NOMATCH */ never executed (the execution status of this line is deduced): md->once_target = prev; | - |
1992 | RRETURN(MATCH_ONCE); never executed: return (-996); | 0 |
1993 | } | - |
1994 | if (*prev >= OP_SBRA) /* Could match an empty string */ partially evaluated: *prev >= OP_SBRA no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1995 | { | - |
1996 | md->match_function_type = MATCH_CBEGROUP; never executed (the execution status of this line is deduced): md->match_function_type = 2; | - |
1997 | RMATCH(eptr, prev, offset_top, md, eptrb, RM50); never executed (the execution status of this line is deduced): rrc = match(eptr,prev,mstart,offset_top,md,eptrb,rdepth+1); | - |
1998 | RRETURN(rrc); never executed: return rrc; | 0 |
1999 | } | - |
2000 | ecode = prev; executed (the execution status of this line is deduced): ecode = prev; | - |
2001 | goto TAIL_RECURSE; executed: goto TAIL_RECURSE; Execution Count:12 | 12 |
2002 | } | - |
2003 | else /* OP_KETRMAX */ | - |
2004 | { | - |
2005 | if (*prev >= OP_SBRA) md->match_function_type = MATCH_CBEGROUP; never executed: md->match_function_type = 2; partially evaluated: *prev >= OP_SBRA no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2006 | RMATCH(eptr, prev, offset_top, md, eptrb, RM13); executed (the execution status of this line is deduced): rrc = match(eptr,prev,mstart,offset_top,md,eptrb,rdepth+1); | - |
2007 | if (rrc == MATCH_ONCE && md->once_target == prev) rrc = MATCH_NOMATCH; never executed: rrc = 0; partially evaluated: rrc == (-996) no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: md->once_target == prev | 0-1 |
2008 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:1 partially evaluated: rrc != 0 yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2009 | if (*prev == OP_ONCE) never evaluated: *prev == OP_ONCE | 0 |
2010 | { | - |
2011 | RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, eptrb, RM9); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode + 1 + 1,mstart,offset_top,md,eptrb,rdepth+1); | - |
2012 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
2013 | md->once_target = prev; never executed (the execution status of this line is deduced): md->once_target = prev; | - |
2014 | RRETURN(MATCH_ONCE); never executed: return (-996); | 0 |
2015 | } | - |
2016 | ecode += 1 + LINK_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
2017 | goto TAIL_RECURSE; never executed: goto TAIL_RECURSE; | 0 |
2018 | } | - |
2019 | /* Control never gets here */ | - |
2020 | | - |
2021 | /* Not multiline mode: start of subject assertion, unless notbol. */ | - |
2022 | | - |
2023 | case OP_CIRC: | - |
2024 | if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: md->notbol no Evaluation Count:0 | yes Evaluation Count:27 |
never evaluated: eptr == md->start_subject | 0-27 |
2025 | | - |
2026 | /* Start of subject assertion */ | - |
2027 | | - |
2028 | case OP_SOD: code before this statement executed: case OP_SOD: Execution Count:27 | 27 |
2029 | if (eptr != md->start_subject) RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:4 evaluated: eptr != md->start_subject yes Evaluation Count:4 | yes Evaluation Count:42 |
| 4-42 |
2030 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2031 | break; executed: break; Execution Count:42 | 42 |
2032 | | - |
2033 | /* Multiline mode: start of subject unless notbol, or after any newline. */ | - |
2034 | | - |
2035 | case OP_CIRCM: | - |
2036 | if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: md->notbol no Evaluation Count:0 | yes Evaluation Count:4 |
never evaluated: eptr == md->start_subject | 0-4 |
2037 | if (eptr != md->start_subject && evaluated: eptr != md->start_subject yes Evaluation Count:3 | yes Evaluation Count:1 |
| 1-3 |
2038 | (eptr == md->end_subject || !WAS_NEWLINE(eptr))) partially evaluated: eptr == md->end_subject no Evaluation Count:0 | yes Evaluation Count:3 |
partially evaluated: (md->nltype != 0) no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
2039 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:1 | 1 |
2040 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2041 | break; executed: break; Execution Count:3 | 3 |
2042 | | - |
2043 | /* Start of match assertion */ | - |
2044 | | - |
2045 | case OP_SOM: | - |
2046 | if (eptr != md->start_subject + md->start_offset) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: eptr != md->start_subject + md->start_offset no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
2047 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2048 | break; executed: break; Execution Count:7 | 7 |
2049 | | - |
2050 | /* Reset the start of match point */ | - |
2051 | | - |
2052 | case OP_SET_SOM: | - |
2053 | mstart = eptr; never executed (the execution status of this line is deduced): mstart = eptr; | - |
2054 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2055 | break; | 0 |
2056 | | - |
2057 | /* Multiline mode: assert before any newline, or before end of subject | - |
2058 | unless noteol is set. */ | - |
2059 | | - |
2060 | case OP_DOLLM: | - |
2061 | if (eptr < md->end_subject) partially evaluated: eptr < md->end_subject yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
2062 | { if (!IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); } executed: return 0; Execution Count:5 executed: } Execution Count:1 partially evaluated: (md->nltype != 0) no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
2063 | else | - |
2064 | { | - |
2065 | if (md->noteol) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: md->noteol | 0 |
2066 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2067 | } | 0 |
2068 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2069 | break; executed: break; Execution Count:1 | 1 |
2070 | | - |
2071 | /* Not multiline mode: assert before a terminating newline or before end of | - |
2072 | subject unless noteol is set. */ | - |
2073 | | - |
2074 | case OP_DOLL: | - |
2075 | if (md->noteol) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: md->noteol no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
2076 | if (!md->endonly) goto ASSERT_NL_OR_EOS; executed: goto ASSERT_NL_OR_EOS; Execution Count:5 partially evaluated: !md->endonly yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
2077 | | - |
2078 | /* ... else fall through for endonly */ | - |
2079 | | - |
2080 | /* End of subject assertion (\z) */ | - |
2081 | | - |
2082 | case OP_EOD: code before this statement never executed: case OP_EOD: | 0 |
2083 | if (eptr < md->end_subject) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: eptr < md->end_subject no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
2084 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:11 |
never evaluated: eptr > md->start_used_ptr | 0-11 |
2085 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2086 | break; executed: break; Execution Count:11 | 11 |
2087 | | - |
2088 | /* End of subject or ending \n assertion (\Z) */ | - |
2089 | | - |
2090 | case OP_EODN: | - |
2091 | ASSERT_NL_OR_EOS: | - |
2092 | if (eptr < md->end_subject && partially evaluated: eptr < md->end_subject no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
2093 | (!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen)) never evaluated: (md->nltype != 0) never evaluated: eptr != md->end_subject - md->nllen | 0 |
2094 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2095 | | - |
2096 | /* Either at end of string or \n before end. */ | - |
2097 | | - |
2098 | SCHECK_PARTIAL(); executed: return (-12); Execution Count:1 executed: } Execution Count:1 evaluated: md->partial > 1 yes Evaluation Count:1 | yes Evaluation Count:1 |
evaluated: md->partial != 0 yes Evaluation Count:2 | yes Evaluation Count:3 |
partially evaluated: eptr > md->start_used_ptr yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-3 |
2099 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2100 | break; executed: break; Execution Count:4 | 4 |
2101 | | - |
2102 | /* Word boundary assertions */ | - |
2103 | | - |
2104 | case OP_NOT_WORD_BOUNDARY: | - |
2105 | case OP_WORD_BOUNDARY: | - |
2106 | { | - |
2107 | | - |
2108 | /* Find out if the previous and current characters are "word" characters. | - |
2109 | It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to | - |
2110 | be "non-word" characters. Remember the earliest consulted character for | - |
2111 | partial matching. */ | - |
2112 | | - |
2113 | #ifdef SUPPORT_UTF | - |
2114 | if (utf) partially evaluated: utf yes Evaluation Count:114 | no Evaluation Count:0 |
| 0-114 |
2115 | { | - |
2116 | /* Get status of previous character */ | - |
2117 | | - |
2118 | if (eptr == md->start_subject) prev_is_word = FALSE; else executed: prev_is_word = 0; Execution Count:6 evaluated: eptr == md->start_subject yes Evaluation Count:6 | yes Evaluation Count:108 |
| 6-108 |
2119 | { | - |
2120 | PCRE_PUCHAR lastptr = eptr - 1; executed (the execution status of this line is deduced): const pcre_uchar * lastptr = eptr - 1; | - |
2121 | BACKCHAR(lastptr); never executed: lastptr--; partially evaluated: (*lastptr & 0xfc00) == 0xdc00 no Evaluation Count:0 | yes Evaluation Count:108 |
| 0-108 |
2122 | if (lastptr < md->start_used_ptr) md->start_used_ptr = lastptr; executed: md->start_used_ptr = lastptr; Execution Count:107 evaluated: lastptr < md->start_used_ptr yes Evaluation Count:107 | yes Evaluation Count:1 |
| 1-107 |
2123 | GETCHAR(c, lastptr); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:108 |
| 0-108 |
2124 | #ifdef SUPPORT_UCP | - |
2125 | if (md->use_ucp) partially evaluated: md->use_ucp no Evaluation Count:0 | yes Evaluation Count:108 |
| 0-108 |
2126 | { | - |
2127 | if (c == '_') prev_is_word = TRUE; else never executed: prev_is_word = 1; never evaluated: c == '_' | 0 |
2128 | { | - |
2129 | int cat = UCD_CATEGORY(c); never executed (the execution status of this line is deduced): int cat = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
2130 | prev_is_word = (cat == ucp_L || cat == ucp_N); never evaluated: cat == ucp_L never evaluated: cat == ucp_N | 0 |
2131 | } | 0 |
2132 | } | - |
2133 | else | - |
2134 | #endif | - |
2135 | prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; executed: prev_is_word = c < 256 && (md->ctypes[c] & 0x10) != 0; Execution Count:108 partially evaluated: c < 256 yes Evaluation Count:108 | no Evaluation Count:0 |
evaluated: (md->ctypes[c] & 0x10) != 0 yes Evaluation Count:76 | yes Evaluation Count:32 |
| 0-108 |
2136 | } | - |
2137 | | - |
2138 | /* Get status of next character */ | - |
2139 | | - |
2140 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:6 | yes Evaluation Count:108 |
| 6-108 |
2141 | { | - |
2142 | SCHECK_PARTIAL(); never executed: return (-12); executed: } Execution Count:2 partially evaluated: md->partial > 1 no Evaluation Count:0 | yes Evaluation Count:2 |
evaluated: md->partial != 0 yes Evaluation Count:2 | yes Evaluation Count:4 |
partially evaluated: eptr > md->start_used_ptr yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-4 |
2143 | cur_is_word = FALSE; executed (the execution status of this line is deduced): cur_is_word = 0; | - |
2144 | } executed: } Execution Count:6 | 6 |
2145 | else | - |
2146 | { | - |
2147 | GETCHAR(c, eptr); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:108 |
| 0-108 |
2148 | #ifdef SUPPORT_UCP | - |
2149 | if (md->use_ucp) partially evaluated: md->use_ucp no Evaluation Count:0 | yes Evaluation Count:108 |
| 0-108 |
2150 | { | - |
2151 | if (c == '_') cur_is_word = TRUE; else never executed: cur_is_word = 1; never evaluated: c == '_' | 0 |
2152 | { | - |
2153 | int cat = UCD_CATEGORY(c); never executed (the execution status of this line is deduced): int cat = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
2154 | cur_is_word = (cat == ucp_L || cat == ucp_N); never evaluated: cat == ucp_L never evaluated: cat == ucp_N | 0 |
2155 | } | 0 |
2156 | } | - |
2157 | else | - |
2158 | #endif | - |
2159 | cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; executed: cur_is_word = c < 256 && (md->ctypes[c] & 0x10) != 0; Execution Count:108 partially evaluated: c < 256 yes Evaluation Count:108 | no Evaluation Count:0 |
evaluated: (md->ctypes[c] & 0x10) != 0 yes Evaluation Count:79 | yes Evaluation Count:29 |
| 0-108 |
2160 | } | - |
2161 | } | - |
2162 | else | - |
2163 | #endif | - |
2164 | | - |
2165 | /* Not in UTF-8 mode, but we may still have PCRE_UCP set, and for | - |
2166 | consistency with the behaviour of \w we do use it in this case. */ | - |
2167 | | - |
2168 | { | - |
2169 | /* Get status of previous character */ | - |
2170 | | - |
2171 | if (eptr == md->start_subject) prev_is_word = FALSE; else never executed: prev_is_word = 0; never evaluated: eptr == md->start_subject | 0 |
2172 | { | - |
2173 | if (eptr <= md->start_used_ptr) md->start_used_ptr = eptr - 1; never executed: md->start_used_ptr = eptr - 1; never evaluated: eptr <= md->start_used_ptr | 0 |
2174 | #ifdef SUPPORT_UCP | - |
2175 | if (md->use_ucp) never evaluated: md->use_ucp | 0 |
2176 | { | - |
2177 | c = eptr[-1]; never executed (the execution status of this line is deduced): c = eptr[-1]; | - |
2178 | if (c == '_') prev_is_word = TRUE; else never executed: prev_is_word = 1; never evaluated: c == '_' | 0 |
2179 | { | - |
2180 | int cat = UCD_CATEGORY(c); never executed (the execution status of this line is deduced): int cat = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
2181 | prev_is_word = (cat == ucp_L || cat == ucp_N); never evaluated: cat == ucp_L never evaluated: cat == ucp_N | 0 |
2182 | } | 0 |
2183 | } | - |
2184 | else | - |
2185 | #endif | - |
2186 | prev_is_word = MAX_255(eptr[-1]) never executed: prev_is_word = ((eptr[-1]) <= 255u) && ((md->ctypes[eptr[-1]] & 0x10) != 0); never evaluated: ((eptr[-1]) <= 255u) | 0 |
2187 | && ((md->ctypes[eptr[-1]] & ctype_word) != 0); never executed: prev_is_word = ((eptr[-1]) <= 255u) && ((md->ctypes[eptr[-1]] & 0x10) != 0); never evaluated: ((md->ctypes[eptr[-1]] & 0x10) != 0) | 0 |
2188 | } | - |
2189 | | - |
2190 | /* Get status of next character */ | - |
2191 | | - |
2192 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2193 | { | - |
2194 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2195 | cur_is_word = FALSE; never executed (the execution status of this line is deduced): cur_is_word = 0; | - |
2196 | } | 0 |
2197 | else | - |
2198 | #ifdef SUPPORT_UCP | - |
2199 | if (md->use_ucp) never evaluated: md->use_ucp | 0 |
2200 | { | - |
2201 | c = *eptr; never executed (the execution status of this line is deduced): c = *eptr; | - |
2202 | if (c == '_') cur_is_word = TRUE; else never executed: cur_is_word = 1; never evaluated: c == '_' | 0 |
2203 | { | - |
2204 | int cat = UCD_CATEGORY(c); never executed (the execution status of this line is deduced): int cat = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
2205 | cur_is_word = (cat == ucp_L || cat == ucp_N); never evaluated: cat == ucp_L never evaluated: cat == ucp_N | 0 |
2206 | } | 0 |
2207 | } | - |
2208 | else | - |
2209 | #endif | - |
2210 | cur_is_word = MAX_255(*eptr) never executed: cur_is_word = ((*eptr) <= 255u) && ((md->ctypes[*eptr] & 0x10) != 0); never evaluated: ((*eptr) <= 255u) | 0 |
2211 | && ((md->ctypes[*eptr] & ctype_word) != 0); never executed: cur_is_word = ((*eptr) <= 255u) && ((md->ctypes[*eptr] & 0x10) != 0); never evaluated: ((md->ctypes[*eptr] & 0x10) != 0) | 0 |
2212 | } | - |
2213 | | - |
2214 | /* Now see if the situation is what we want */ | - |
2215 | | - |
2216 | if ((*ecode++ == OP_WORD_BOUNDARY)? partially evaluated: (*ecode++ == OP_WORD_BOUNDARY) yes Evaluation Count:114 | no Evaluation Count:0 |
| 0-114 |
2217 | cur_is_word == prev_is_word : cur_is_word != prev_is_word) executed (the execution status of this line is deduced): cur_is_word == prev_is_word : cur_is_word != prev_is_word) | - |
2218 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:51 | 51 |
2219 | } | - |
2220 | break; executed: break; Execution Count:63 | 63 |
2221 | | - |
2222 | /* Match a single character type; inline for speed */ | - |
2223 | | - |
2224 | case OP_ANY: | - |
2225 | if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: (md->nltype != 0) no Evaluation Count:0 | yes Evaluation Count:11 |
| 0-11 |
2226 | /* Fall through */ | - |
2227 | | - |
2228 | case OP_ALLANY: code before this statement executed: case OP_ALLANY: Execution Count:11 | 11 |
2229 | if (eptr >= md->end_subject) /* DO NOT merge the eptr++ here; it must */ evaluated: eptr >= md->end_subject yes Evaluation Count:8 | yes Evaluation Count:3 |
| 3-8 |
2230 | { /* not be updated before SCHECK_PARTIAL. */ | - |
2231 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:8 |
never evaluated: eptr > md->start_used_ptr | 0-8 |
2232 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:8 | 8 |
2233 | } | - |
2234 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
2235 | #ifdef SUPPORT_UTF | - |
2236 | if (utf) ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); never executed: eptr++; partially evaluated: utf yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: (eptr < md->end_subject) yes Evaluation Count:3 | no Evaluation Count:0 |
partially evaluated: ((*eptr) & 0xfc00) == 0xdc00 no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
2237 | #endif | - |
2238 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2239 | break; executed: break; Execution Count:3 | 3 |
2240 | | - |
2241 | /* Match a single byte, even in UTF-8 mode. This opcode really does match | - |
2242 | any byte, even newline, independent of the setting of PCRE_DOTALL. */ | - |
2243 | | - |
2244 | case OP_ANYBYTE: | - |
2245 | if (eptr >= md->end_subject) /* DO NOT merge the eptr++ here; it must */ never evaluated: eptr >= md->end_subject | 0 |
2246 | { /* not be updated before SCHECK_PARTIAL. */ | - |
2247 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2248 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2249 | } | - |
2250 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
2251 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2252 | break; | 0 |
2253 | | - |
2254 | case OP_NOT_DIGIT: | - |
2255 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2256 | { | - |
2257 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2258 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2259 | } | - |
2260 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2261 | if ( | - |
2262 | #if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) | - |
2263 | c < 256 && | 0 |
2264 | #endif never executed (the execution status of this line is deduced):
| - |
2265 | (md->ctypes[c] & ctype_digit) != 0 never evaluated: (md->ctypes[c] & 0x04) != 0 | 0 |
2266 | ) | - |
2267 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2268 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2269 | break; | 0 |
2270 | | - |
2271 | case OP_DIGIT: | - |
2272 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
2273 | { | - |
2274 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2275 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2276 | } | - |
2277 | GETCHARINCTEST(c, eptr); never executed: } partially evaluated: utf yes Evaluation Count:4 | no Evaluation Count:0 |
partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
2278 | if ( | - |
2279 | #if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) | - |
2280 | c > 255 || partially evaluated: c > 255 no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
2281 | #endif executed (the execution status of this line is deduced):
| - |
2282 | (md->ctypes[c] & ctype_digit) == 0 partially evaluated: (md->ctypes[c] & 0x04) == 0 no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
2283 | ) | - |
2284 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2285 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2286 | break; executed: break; Execution Count:4 | 4 |
2287 | | - |
2288 | case OP_NOT_WHITESPACE: | - |
2289 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2290 | { | - |
2291 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2292 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2293 | } | - |
2294 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2295 | if ( | - |
2296 | #if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) | - |
2297 | c < 256 && | 0 |
2298 | #endif never executed (the execution status of this line is deduced):
| - |
2299 | (md->ctypes[c] & ctype_space) != 0 never evaluated: (md->ctypes[c] & 0x01) != 0 | 0 |
2300 | ) | - |
2301 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2302 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2303 | break; | 0 |
2304 | | - |
2305 | case OP_WHITESPACE: | - |
2306 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2307 | { | - |
2308 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2309 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2310 | } | - |
2311 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2312 | if ( | - |
2313 | #if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) | - |
2314 | c > 255 || | 0 |
2315 | #endif never executed (the execution status of this line is deduced):
| - |
2316 | (md->ctypes[c] & ctype_space) == 0 never evaluated: (md->ctypes[c] & 0x01) == 0 | 0 |
2317 | ) | - |
2318 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2319 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2320 | break; | 0 |
2321 | | - |
2322 | case OP_NOT_WORDCHAR: | - |
2323 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2324 | { | - |
2325 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2326 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2327 | } | - |
2328 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2329 | if ( | - |
2330 | #if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) | - |
2331 | c < 256 && | 0 |
2332 | #endif never executed (the execution status of this line is deduced):
| - |
2333 | (md->ctypes[c] & ctype_word) != 0 never evaluated: (md->ctypes[c] & 0x10) != 0 | 0 |
2334 | ) | - |
2335 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2336 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2337 | break; | 0 |
2338 | | - |
2339 | case OP_WORDCHAR: | - |
2340 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:54 |
| 0-54 |
2341 | { | - |
2342 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2343 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2344 | } | - |
2345 | GETCHARINCTEST(c, eptr); never executed: } partially evaluated: utf yes Evaluation Count:54 | no Evaluation Count:0 |
partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:54 |
| 0-54 |
2346 | if ( | - |
2347 | #if defined SUPPORT_UTF || !(defined COMPILE_PCRE8) | - |
2348 | c > 255 || partially evaluated: c > 255 no Evaluation Count:0 | yes Evaluation Count:54 |
| 0-54 |
2349 | #endif executed (the execution status of this line is deduced):
| - |
2350 | (md->ctypes[c] & ctype_word) == 0 partially evaluated: (md->ctypes[c] & 0x10) == 0 no Evaluation Count:0 | yes Evaluation Count:54 |
| 0-54 |
2351 | ) | - |
2352 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2353 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
2354 | break; executed: break; Execution Count:54 | 54 |
2355 | | - |
2356 | case OP_ANYNL: | - |
2357 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2358 | { | - |
2359 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2360 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2361 | } | - |
2362 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2363 | switch(c) | - |
2364 | { | - |
2365 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2366 | | - |
2367 | case 0x000d: | - |
2368 | if (eptr < md->end_subject && *eptr == 0x0a) eptr++; never executed: eptr++; never evaluated: eptr < md->end_subject never evaluated: *eptr == 0x0a | 0 |
2369 | break; | 0 |
2370 | | - |
2371 | case 0x000a: | - |
2372 | break; | 0 |
2373 | | - |
2374 | case 0x000b: | - |
2375 | case 0x000c: | - |
2376 | case 0x0085: | - |
2377 | case 0x2028: | - |
2378 | case 0x2029: | - |
2379 | if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: md->bsr_anycrlf | 0 |
2380 | break; | 0 |
2381 | } | - |
2382 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2383 | break; | 0 |
2384 | | - |
2385 | case OP_NOT_HSPACE: | - |
2386 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2387 | { | - |
2388 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2389 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2390 | } | - |
2391 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2392 | switch(c) | - |
2393 | { | - |
2394 | default: break; | 0 |
2395 | case 0x09: /* HT */ | - |
2396 | case 0x20: /* SPACE */ | - |
2397 | case 0xa0: /* NBSP */ | - |
2398 | case 0x1680: /* OGHAM SPACE MARK */ | - |
2399 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
2400 | case 0x2000: /* EN QUAD */ | - |
2401 | case 0x2001: /* EM QUAD */ | - |
2402 | case 0x2002: /* EN SPACE */ | - |
2403 | case 0x2003: /* EM SPACE */ | - |
2404 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
2405 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
2406 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
2407 | case 0x2007: /* FIGURE SPACE */ | - |
2408 | case 0x2008: /* PUNCTUATION SPACE */ | - |
2409 | case 0x2009: /* THIN SPACE */ | - |
2410 | case 0x200A: /* HAIR SPACE */ | - |
2411 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
2412 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
2413 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
2414 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2415 | } | - |
2416 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2417 | break; | 0 |
2418 | | - |
2419 | case OP_HSPACE: | - |
2420 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2421 | { | - |
2422 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2423 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2424 | } | - |
2425 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2426 | switch(c) | - |
2427 | { | - |
2428 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2429 | case 0x09: /* HT */ | - |
2430 | case 0x20: /* SPACE */ | - |
2431 | case 0xa0: /* NBSP */ | - |
2432 | case 0x1680: /* OGHAM SPACE MARK */ | - |
2433 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
2434 | case 0x2000: /* EN QUAD */ | - |
2435 | case 0x2001: /* EM QUAD */ | - |
2436 | case 0x2002: /* EN SPACE */ | - |
2437 | case 0x2003: /* EM SPACE */ | - |
2438 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
2439 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
2440 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
2441 | case 0x2007: /* FIGURE SPACE */ | - |
2442 | case 0x2008: /* PUNCTUATION SPACE */ | - |
2443 | case 0x2009: /* THIN SPACE */ | - |
2444 | case 0x200A: /* HAIR SPACE */ | - |
2445 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
2446 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
2447 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
2448 | break; | 0 |
2449 | } | - |
2450 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2451 | break; | 0 |
2452 | | - |
2453 | case OP_NOT_VSPACE: | - |
2454 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2455 | { | - |
2456 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2457 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2458 | } | - |
2459 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2460 | switch(c) | - |
2461 | { | - |
2462 | default: break; | 0 |
2463 | case 0x0a: /* LF */ | - |
2464 | case 0x0b: /* VT */ | - |
2465 | case 0x0c: /* FF */ | - |
2466 | case 0x0d: /* CR */ | - |
2467 | case 0x85: /* NEL */ | - |
2468 | case 0x2028: /* LINE SEPARATOR */ | - |
2469 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
2470 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2471 | } | - |
2472 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2473 | break; | 0 |
2474 | | - |
2475 | case OP_VSPACE: | - |
2476 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2477 | { | - |
2478 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2479 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2480 | } | - |
2481 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2482 | switch(c) | - |
2483 | { | - |
2484 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2485 | case 0x0a: /* LF */ | - |
2486 | case 0x0b: /* VT */ | - |
2487 | case 0x0c: /* FF */ | - |
2488 | case 0x0d: /* CR */ | - |
2489 | case 0x85: /* NEL */ | - |
2490 | case 0x2028: /* LINE SEPARATOR */ | - |
2491 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
2492 | break; | 0 |
2493 | } | - |
2494 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2495 | break; | 0 |
2496 | | - |
2497 | #ifdef SUPPORT_UCP | - |
2498 | /* Check the next character by Unicode property. We will get here only | - |
2499 | if the support is in the binary; otherwise a compile-time error occurs. */ | - |
2500 | | - |
2501 | case OP_PROP: | - |
2502 | case OP_NOTPROP: | - |
2503 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2504 | { | - |
2505 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2506 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2507 | } | - |
2508 | GETCHARINCTEST(c, eptr); never executed: } partially evaluated: utf yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2509 | { | - |
2510 | const ucd_record *prop = GET_UCD(c); executed (the execution status of this line is deduced): const ucd_record *prop = (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128]); | - |
2511 | | - |
2512 | switch(ecode[1]) | - |
2513 | { | - |
2514 | case PT_ANY: | - |
2515 | if (op == OP_NOTPROP) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: op == OP_NOTPROP | 0 |
2516 | break; | 0 |
2517 | | - |
2518 | case PT_LAMP: | - |
2519 | if ((prop->chartype == ucp_Lu || never evaluated: (prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) == (op == OP_NOTPROP) never evaluated: prop->chartype == ucp_Lu | 0 |
2520 | prop->chartype == ucp_Ll || never evaluated: (prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) == (op == OP_NOTPROP) never evaluated: prop->chartype == ucp_Ll | 0 |
2521 | prop->chartype == ucp_Lt) == (op == OP_NOTPROP)) never evaluated: (prop->chartype == ucp_Lu || prop->chartype == ucp_Ll || prop->chartype == ucp_Lt) == (op == OP_NOTPROP) never evaluated: prop->chartype == ucp_Lt | 0 |
2522 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2523 | break; | 0 |
2524 | | - |
2525 | case PT_GC: | - |
2526 | if ((ecode[2] != PRIV(ucp_gentype)[prop->chartype]) == (op == OP_PROP)) never evaluated: (ecode[2] != _pcre16_ucp_gentype[prop->chartype]) == (op == OP_PROP) | 0 |
2527 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2528 | break; | 0 |
2529 | | - |
2530 | case PT_PC: | - |
2531 | if ((ecode[2] != prop->chartype) == (op == OP_PROP)) partially evaluated: (ecode[2] != prop->chartype) == (op == OP_PROP) yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2532 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:2 | 2 |
2533 | break; | 0 |
2534 | | - |
2535 | case PT_SC: | - |
2536 | if ((ecode[2] != prop->script) == (op == OP_PROP)) never evaluated: (ecode[2] != prop->script) == (op == OP_PROP) | 0 |
2537 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2538 | break; | 0 |
2539 | | - |
2540 | /* These are specials */ | - |
2541 | | - |
2542 | case PT_ALNUM: | - |
2543 | if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_L || _pcre16_ucp_gentype[prop->chartype] == ucp_N) == (op == OP_NOTPROP) never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L | 0 |
2544 | PRIV(ucp_gentype)[prop->chartype] == ucp_N) == (op == OP_NOTPROP)) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_L || _pcre16_ucp_gentype[prop->chartype] == ucp_N) == (op == OP_NOTPROP) never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N | 0 |
2545 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2546 | break; | 0 |
2547 | | - |
2548 | case PT_SPACE: /* Perl space */ | - |
2549 | if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z || never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == (op == OP_NOTPROP) never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z | 0 |
2550 | c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == (op == OP_NOTPROP) never evaluated: c == '\011' never evaluated: c == '\012' never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
2551 | == (op == OP_NOTPROP)) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == (op == OP_NOTPROP) | 0 |
2552 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2553 | break; | 0 |
2554 | | - |
2555 | case PT_PXSPACE: /* POSIX space */ | - |
2556 | if ((PRIV(ucp_gentype)[prop->chartype] == ucp_Z || never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == (op == OP_NOTPROP) never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z | 0 |
2557 | c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == (op == OP_NOTPROP) never evaluated: c == '\011' never evaluated: c == '\012' never evaluated: c == '\013' | 0 |
2558 | c == CHAR_FF || c == CHAR_CR) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == (op == OP_NOTPROP) never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
2559 | == (op == OP_NOTPROP)) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == (op == OP_NOTPROP) | 0 |
2560 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2561 | break; | 0 |
2562 | | - |
2563 | case PT_WORD: | - |
2564 | if ((PRIV(ucp_gentype)[prop->chartype] == ucp_L || never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_L || _pcre16_ucp_gentype[prop->chartype] == ucp_N || c == '\137') == (op == OP_NOTPROP) never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L | 0 |
2565 | PRIV(ucp_gentype)[prop->chartype] == ucp_N || never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_L || _pcre16_ucp_gentype[prop->chartype] == ucp_N || c == '\137') == (op == OP_NOTPROP) never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N | 0 |
2566 | c == CHAR_UNDERSCORE) == (op == OP_NOTPROP)) never evaluated: (_pcre16_ucp_gentype[prop->chartype] == ucp_L || _pcre16_ucp_gentype[prop->chartype] == ucp_N || c == '\137') == (op == OP_NOTPROP) never evaluated: c == '\137' | 0 |
2567 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2568 | break; | 0 |
2569 | | - |
2570 | /* This should never occur */ | - |
2571 | | - |
2572 | default: | - |
2573 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
2574 | } | - |
2575 | | - |
2576 | ecode += 3; never executed (the execution status of this line is deduced): ecode += 3; | - |
2577 | } | - |
2578 | break; | 0 |
2579 | | - |
2580 | /* Match an extended Unicode sequence. We will get here only if the support | - |
2581 | is in the binary; otherwise a compile-time error occurs. */ | - |
2582 | | - |
2583 | case OP_EXTUNI: | - |
2584 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2585 | { | - |
2586 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2587 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2588 | } | - |
2589 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2590 | if (UCD_CATEGORY(c) == ucp_M) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_M | 0 |
2591 | while (eptr < md->end_subject) never evaluated: eptr < md->end_subject | 0 |
2592 | { | - |
2593 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
2594 | if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } never executed: c = *eptr; never executed: } never executed: } never evaluated: (c & 0xfc00) == 0xd800 never evaluated: !utf | 0 |
2595 | if (UCD_CATEGORY(c) != ucp_M) break; never executed: break; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M | 0 |
2596 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
2597 | } | 0 |
2598 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
2599 | break; | 0 |
2600 | #endif | - |
2601 | | - |
2602 | | - |
2603 | /* Match a back reference, possibly repeatedly. Look past the end of the | - |
2604 | item to see if there is repeat information following. The code is similar | - |
2605 | to that for character classes, but repeated for efficiency. Then obey | - |
2606 | similar code to character type repeats - written out again for speed. | - |
2607 | However, if the referenced string is the empty string, always treat | - |
2608 | it as matched, any number of times (otherwise there could be infinite | - |
2609 | loops). */ | - |
2610 | | - |
2611 | case OP_REF: | - |
2612 | case OP_REFI: | - |
2613 | caseless = op == OP_REFI; never executed (the execution status of this line is deduced): caseless = op == OP_REFI; | - |
2614 | offset = GET2(ecode, 1) << 1; /* Doubled ref number */ never executed (the execution status of this line is deduced): offset = ecode[1] << 1; | - |
2615 | ecode += 1 + IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
2616 | | - |
2617 | /* If the reference is unset, there are two possibilities: | - |
2618 | | - |
2619 | (a) In the default, Perl-compatible state, set the length negative; | - |
2620 | this ensures that every attempt at a match fails. We can't just fail | - |
2621 | here, because of the possibility of quantifiers with zero minima. | - |
2622 | | - |
2623 | (b) If the JavaScript compatibility flag is set, set the length to zero | - |
2624 | so that the back reference matches an empty string. | - |
2625 | | - |
2626 | Otherwise, set the length to the length of what was matched by the | - |
2627 | referenced subpattern. */ | - |
2628 | | - |
2629 | if (offset >= offset_top || md->offset_vector[offset] < 0) never evaluated: offset >= offset_top never evaluated: md->offset_vector[offset] < 0 | 0 |
2630 | length = (md->jscript_compat)? 0 : -1; never executed: length = (md->jscript_compat)? 0 : -1; never evaluated: (md->jscript_compat) | 0 |
2631 | else | - |
2632 | length = md->offset_vector[offset+1] - md->offset_vector[offset]; never executed: length = md->offset_vector[offset+1] - md->offset_vector[offset]; | 0 |
2633 | | - |
2634 | /* Set up for repetition, or handle the non-repeated case */ | - |
2635 | | - |
2636 | switch (*ecode) | - |
2637 | { | - |
2638 | case OP_CRSTAR: | - |
2639 | case OP_CRMINSTAR: | - |
2640 | case OP_CRPLUS: | - |
2641 | case OP_CRMINPLUS: | - |
2642 | case OP_CRQUERY: | - |
2643 | case OP_CRMINQUERY: | - |
2644 | c = *ecode++ - OP_CRSTAR; never executed (the execution status of this line is deduced): c = *ecode++ - OP_CRSTAR; | - |
2645 | minimize = (c & 1) != 0; never executed (the execution status of this line is deduced): minimize = (c & 1) != 0; | - |
2646 | min = rep_min[c]; /* Pick up values from tables; */ never executed (the execution status of this line is deduced): min = rep_min[c]; | - |
2647 | max = rep_max[c]; /* zero for max => infinity */ never executed (the execution status of this line is deduced): max = rep_max[c]; | - |
2648 | if (max == 0) max = INT_MAX; never executed: max = 2147483647; never evaluated: max == 0 | 0 |
2649 | break; | 0 |
2650 | | - |
2651 | case OP_CRRANGE: | - |
2652 | case OP_CRMINRANGE: | - |
2653 | minimize = (*ecode == OP_CRMINRANGE); never executed (the execution status of this line is deduced): minimize = (*ecode == OP_CRMINRANGE); | - |
2654 | min = GET2(ecode, 1); never executed (the execution status of this line is deduced): min = ecode[1]; | - |
2655 | max = GET2(ecode, 1 + IMM2_SIZE); never executed (the execution status of this line is deduced): max = ecode[1 + 1]; | - |
2656 | if (max == 0) max = INT_MAX; never executed: max = 2147483647; never evaluated: max == 0 | 0 |
2657 | ecode += 1 + 2 * IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 2 * 1; | - |
2658 | break; | 0 |
2659 | | - |
2660 | default: /* No repeat follows */ | - |
2661 | if ((length = match_ref(offset, eptr, length, md, caseless)) < 0) never evaluated: (length = match_ref(offset, eptr, length, md, caseless)) < 0 | 0 |
2662 | { | - |
2663 | CHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr >= md->end_subject never evaluated: eptr > md->start_used_ptr | 0 |
2664 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2665 | } | - |
2666 | eptr += length; never executed (the execution status of this line is deduced): eptr += length; | - |
2667 | continue; /* With the main loop */ never executed: continue; | 0 |
2668 | } | - |
2669 | | - |
2670 | /* Handle repeated back references. If the length of the reference is | - |
2671 | zero, just continue with the main loop. If the length is negative, it | - |
2672 | means the reference is unset in non-Java-compatible mode. If the minimum is | - |
2673 | zero, we can continue at the same level without recursion. For any other | - |
2674 | minimum, carrying on will result in NOMATCH. */ | - |
2675 | | - |
2676 | if (length == 0) continue; never executed: continue; never evaluated: length == 0 | 0 |
2677 | if (length < 0 && min == 0) continue; never executed: continue; never evaluated: length < 0 never evaluated: min == 0 | 0 |
2678 | | - |
2679 | /* First, ensure the minimum number of matches are present. We get back | - |
2680 | the length of the reference string explicitly rather than passing the | - |
2681 | address of eptr, so that eptr can be a register variable. */ | - |
2682 | | - |
2683 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
2684 | { | - |
2685 | int slength; never executed (the execution status of this line is deduced): int slength; | - |
2686 | if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) never evaluated: (slength = match_ref(offset, eptr, length, md, caseless)) < 0 | 0 |
2687 | { | - |
2688 | CHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr >= md->end_subject never evaluated: eptr > md->start_used_ptr | 0 |
2689 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2690 | } | - |
2691 | eptr += slength; never executed (the execution status of this line is deduced): eptr += slength; | - |
2692 | } | 0 |
2693 | | - |
2694 | /* If min = max, continue at the same level without recursion. | - |
2695 | They are not both allowed to be zero. */ | - |
2696 | | - |
2697 | if (min == max) continue; never executed: continue; never evaluated: min == max | 0 |
2698 | | - |
2699 | /* If minimizing, keep trying and advancing the pointer */ | - |
2700 | | - |
2701 | if (minimize) never evaluated: minimize | 0 |
2702 | { | - |
2703 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
2704 | { | - |
2705 | int slength; never executed (the execution status of this line is deduced): int slength; | - |
2706 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM14); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
2707 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
2708 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
2709 | if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) never evaluated: (slength = match_ref(offset, eptr, length, md, caseless)) < 0 | 0 |
2710 | { | - |
2711 | CHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr >= md->end_subject never evaluated: eptr > md->start_used_ptr | 0 |
2712 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2713 | } | - |
2714 | eptr += slength; never executed (the execution status of this line is deduced): eptr += slength; | - |
2715 | } | 0 |
2716 | /* Control never gets here */ | - |
2717 | } | 0 |
2718 | | - |
2719 | /* If maximizing, find the longest string and work backwards */ | - |
2720 | | - |
2721 | else | - |
2722 | { | - |
2723 | pp = eptr; never executed (the execution status of this line is deduced): pp = eptr; | - |
2724 | for (i = min; i < max; i++) | 0 |
2725 | { | - |
2726 | int slength; never executed (the execution status of this line is deduced): int slength; | - |
2727 | if ((slength = match_ref(offset, eptr, length, md, caseless)) < 0) never evaluated: (slength = match_ref(offset, eptr, length, md, caseless)) < 0 | 0 |
2728 | { | - |
2729 | CHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr >= md->end_subject never evaluated: eptr > md->start_used_ptr | 0 |
2730 | break; | 0 |
2731 | } | - |
2732 | eptr += slength; never executed (the execution status of this line is deduced): eptr += slength; | - |
2733 | } | 0 |
2734 | while (eptr >= pp) never evaluated: eptr >= pp | 0 |
2735 | { | - |
2736 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM15); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
2737 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
2738 | eptr -= length; never executed (the execution status of this line is deduced): eptr -= length; | - |
2739 | } | 0 |
2740 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2741 | } | - |
2742 | /* Control never gets here */ | - |
2743 | | - |
2744 | /* Match a bit-mapped character class, possibly repeatedly. This op code is | - |
2745 | used when all the characters in the class have values in the range 0-255, | - |
2746 | and either the matching is caseful, or the characters are in the range | - |
2747 | 0-127 when UTF-8 processing is enabled. The only difference between | - |
2748 | OP_CLASS and OP_NCLASS occurs when a data character outside the range is | - |
2749 | encountered. | - |
2750 | | - |
2751 | First, look past the end of the item to see if there is repeat information | - |
2752 | following. Then obey similar code to character type repeats - written out | - |
2753 | again for speed. */ | - |
2754 | | - |
2755 | case OP_NCLASS: code before this statement never executed: case OP_NCLASS: | 0 |
2756 | case OP_CLASS: | - |
2757 | { | - |
2758 | /* The data variable is saved across frames, so the byte map needs to | - |
2759 | be stored there. */ | - |
2760 | #define BYTE_MAP ((pcre_uint8 *)data) | - |
2761 | data = ecode + 1; /* Save for matching */ executed (the execution status of this line is deduced): data = ecode + 1; | - |
2762 | ecode += 1 + (32 / sizeof(pcre_uchar)); /* Advance past the item */ executed (the execution status of this line is deduced): ecode += 1 + (32 / sizeof(pcre_uchar)); | - |
2763 | | - |
2764 | switch (*ecode) | - |
2765 | { | - |
2766 | case OP_CRSTAR: | - |
2767 | case OP_CRMINSTAR: | - |
2768 | case OP_CRPLUS: | - |
2769 | case OP_CRMINPLUS: | - |
2770 | case OP_CRQUERY: | - |
2771 | case OP_CRMINQUERY: | - |
2772 | c = *ecode++ - OP_CRSTAR; never executed (the execution status of this line is deduced): c = *ecode++ - OP_CRSTAR; | - |
2773 | minimize = (c & 1) != 0; never executed (the execution status of this line is deduced): minimize = (c & 1) != 0; | - |
2774 | min = rep_min[c]; /* Pick up values from tables; */ never executed (the execution status of this line is deduced): min = rep_min[c]; | - |
2775 | max = rep_max[c]; /* zero for max => infinity */ never executed (the execution status of this line is deduced): max = rep_max[c]; | - |
2776 | if (max == 0) max = INT_MAX; never executed: max = 2147483647; never evaluated: max == 0 | 0 |
2777 | break; | 0 |
2778 | | - |
2779 | case OP_CRRANGE: | - |
2780 | case OP_CRMINRANGE: | - |
2781 | minimize = (*ecode == OP_CRMINRANGE); never executed (the execution status of this line is deduced): minimize = (*ecode == OP_CRMINRANGE); | - |
2782 | min = GET2(ecode, 1); never executed (the execution status of this line is deduced): min = ecode[1]; | - |
2783 | max = GET2(ecode, 1 + IMM2_SIZE); never executed (the execution status of this line is deduced): max = ecode[1 + 1]; | - |
2784 | if (max == 0) max = INT_MAX; never executed: max = 2147483647; never evaluated: max == 0 | 0 |
2785 | ecode += 1 + 2 * IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 2 * 1; | - |
2786 | break; | 0 |
2787 | | - |
2788 | default: /* No repeat follows */ | - |
2789 | min = max = 1; executed (the execution status of this line is deduced): min = max = 1; | - |
2790 | break; executed: break; Execution Count:125 | 125 |
2791 | } | - |
2792 | | - |
2793 | /* First, ensure the minimum number of matches are present. */ | - |
2794 | | - |
2795 | #ifdef SUPPORT_UTF | - |
2796 | if (utf) partially evaluated: utf yes Evaluation Count:125 | no Evaluation Count:0 |
| 0-125 |
2797 | { | - |
2798 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:125 | yes Evaluation Count:52 |
| 52-125 |
2799 | { | - |
2800 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:16 | yes Evaluation Count:109 |
| 16-109 |
2801 | { | - |
2802 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:16 |
never evaluated: eptr > md->start_used_ptr | 0-16 |
2803 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:16 | 16 |
2804 | } | - |
2805 | GETCHARINC(c, eptr); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:109 |
| 0-109 |
2806 | if (c > 255) partially evaluated: c > 255 no Evaluation Count:0 | yes Evaluation Count:109 |
| 0-109 |
2807 | { | - |
2808 | if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: op == OP_CLASS | 0 |
2809 | } | 0 |
2810 | else | - |
2811 | if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:57 evaluated: (((pcre_uint8 *)data)[c/8] & (1 << (c&7))) == 0 yes Evaluation Count:57 | yes Evaluation Count:52 |
| 52-57 |
2812 | } | - |
2813 | } executed: } Execution Count:52 | 52 |
2814 | else | - |
2815 | #endif | - |
2816 | /* Not UTF mode */ | - |
2817 | { | - |
2818 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
2819 | { | - |
2820 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2821 | { | - |
2822 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2823 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2824 | } | - |
2825 | c = *eptr++; never executed (the execution status of this line is deduced): c = *eptr++; | - |
2826 | #ifndef COMPILE_PCRE8 | - |
2827 | if (c > 255) | 0 |
2828 | { | - |
2829 | if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: op == OP_CLASS | 0 |
2830 | } | 0 |
2831 | else | - |
2832 | #endif | - |
2833 | if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: (((pcre_uint8 *)data)[c/8] & (1 << (c&7))) == 0 | 0 |
2834 | } | - |
2835 | } | 0 |
2836 | | - |
2837 | /* If max == min we can continue with the main loop without the | - |
2838 | need to recurse. */ | - |
2839 | | - |
2840 | if (min == max) continue; executed: continue; Execution Count:52 partially evaluated: min == max yes Evaluation Count:52 | no Evaluation Count:0 |
| 0-52 |
2841 | | - |
2842 | /* If minimizing, keep testing the rest of the expression and advancing | - |
2843 | the pointer while it matches the class. */ | - |
2844 | | - |
2845 | if (minimize) never evaluated: minimize | 0 |
2846 | { | - |
2847 | #ifdef SUPPORT_UTF | - |
2848 | if (utf) | 0 |
2849 | { | - |
2850 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
2851 | { | - |
2852 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM16); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
2853 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
2854 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
2855 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2856 | { | - |
2857 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2858 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2859 | } | - |
2860 | GETCHARINC(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2861 | if (c > 255) | 0 |
2862 | { | - |
2863 | if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: op == OP_CLASS | 0 |
2864 | } | 0 |
2865 | else | - |
2866 | if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: (((pcre_uint8 *)data)[c/8] & (1 << (c&7))) == 0 | 0 |
2867 | } | - |
2868 | } | 0 |
2869 | else | - |
2870 | #endif | - |
2871 | /* Not UTF mode */ | - |
2872 | { | - |
2873 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
2874 | { | - |
2875 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM17); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
2876 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
2877 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
2878 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2879 | { | - |
2880 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2881 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2882 | } | - |
2883 | c = *eptr++; never executed (the execution status of this line is deduced): c = *eptr++; | - |
2884 | #ifndef COMPILE_PCRE8 | - |
2885 | if (c > 255) | 0 |
2886 | { | - |
2887 | if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: op == OP_CLASS | 0 |
2888 | } | 0 |
2889 | else | - |
2890 | #endif | - |
2891 | if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: (((pcre_uint8 *)data)[c/8] & (1 << (c&7))) == 0 | 0 |
2892 | } | - |
2893 | } | 0 |
2894 | /* Control never gets here */ | - |
2895 | } | - |
2896 | | - |
2897 | /* If maximizing, find the longest possible run, then work backwards. */ | - |
2898 | | - |
2899 | else | - |
2900 | { | - |
2901 | pp = eptr; never executed (the execution status of this line is deduced): pp = eptr; | - |
2902 | | - |
2903 | #ifdef SUPPORT_UTF | - |
2904 | if (utf) | 0 |
2905 | { | - |
2906 | for (i = min; i < max; i++) | 0 |
2907 | { | - |
2908 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
2909 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2910 | { | - |
2911 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2912 | break; | 0 |
2913 | } | - |
2914 | GETCHARLEN(c, eptr, len); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
2915 | if (c > 255) | 0 |
2916 | { | - |
2917 | if (op == OP_CLASS) break; never executed: break; never evaluated: op == OP_CLASS | 0 |
2918 | } | 0 |
2919 | else | - |
2920 | if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break; never executed: break; never evaluated: (((pcre_uint8 *)data)[c/8] & (1 << (c&7))) == 0 | 0 |
2921 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
2922 | } | 0 |
2923 | for (;;) never executed (the execution status of this line is deduced): for (;;) | - |
2924 | { | - |
2925 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM18); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
2926 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
2927 | if (eptr-- == pp) break; /* Stop if tried at original pos */ never executed: break; never evaluated: eptr-- == pp | 0 |
2928 | BACKCHAR(eptr); never executed: eptr--; never evaluated: (*eptr & 0xfc00) == 0xdc00 | 0 |
2929 | } | 0 |
2930 | } | 0 |
2931 | else | - |
2932 | #endif | - |
2933 | /* Not UTF mode */ | - |
2934 | { | - |
2935 | for (i = min; i < max; i++) | 0 |
2936 | { | - |
2937 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
2938 | { | - |
2939 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
2940 | break; | 0 |
2941 | } | - |
2942 | c = *eptr; never executed (the execution status of this line is deduced): c = *eptr; | - |
2943 | #ifndef COMPILE_PCRE8 | - |
2944 | if (c > 255) | 0 |
2945 | { | - |
2946 | if (op == OP_CLASS) break; never executed: break; never evaluated: op == OP_CLASS | 0 |
2947 | } | 0 |
2948 | else | - |
2949 | #endif | - |
2950 | if ((BYTE_MAP[c/8] & (1 << (c&7))) == 0) break; never executed: break; never evaluated: (((pcre_uint8 *)data)[c/8] & (1 << (c&7))) == 0 | 0 |
2951 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
2952 | } | 0 |
2953 | while (eptr >= pp) never evaluated: eptr >= pp | 0 |
2954 | { | - |
2955 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM19); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
2956 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
2957 | eptr--; never executed (the execution status of this line is deduced): eptr--; | - |
2958 | } | 0 |
2959 | } | 0 |
2960 | | - |
2961 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
2962 | } | - |
2963 | #undef BYTE_MAP | - |
2964 | } | - |
2965 | /* Control never gets here */ | - |
2966 | | - |
2967 | | - |
2968 | /* Match an extended character class. This opcode is encountered only | - |
2969 | when UTF-8 mode mode is supported. Nevertheless, we may not be in UTF-8 | - |
2970 | mode, because Unicode properties are supported in non-UTF-8 mode. */ | - |
2971 | | - |
2972 | #if defined SUPPORT_UTF || !defined COMPILE_PCRE8 | - |
2973 | case OP_XCLASS: code before this statement never executed: case OP_XCLASS: | 0 |
2974 | { | - |
2975 | data = ecode + 1 + LINK_SIZE; /* Save for matching */ executed (the execution status of this line is deduced): data = ecode + 1 + 1; | - |
2976 | ecode += GET(ecode, 1); /* Advance past the item */ executed (the execution status of this line is deduced): ecode += (ecode[1]); | - |
2977 | | - |
2978 | switch (*ecode) | - |
2979 | { | - |
2980 | case OP_CRSTAR: | - |
2981 | case OP_CRMINSTAR: | - |
2982 | case OP_CRPLUS: | - |
2983 | case OP_CRMINPLUS: | - |
2984 | case OP_CRQUERY: | - |
2985 | case OP_CRMINQUERY: | - |
2986 | c = *ecode++ - OP_CRSTAR; executed (the execution status of this line is deduced): c = *ecode++ - OP_CRSTAR; | - |
2987 | minimize = (c & 1) != 0; executed (the execution status of this line is deduced): minimize = (c & 1) != 0; | - |
2988 | min = rep_min[c]; /* Pick up values from tables; */ executed (the execution status of this line is deduced): min = rep_min[c]; | - |
2989 | max = rep_max[c]; /* zero for max => infinity */ executed (the execution status of this line is deduced): max = rep_max[c]; | - |
2990 | if (max == 0) max = INT_MAX; executed: max = 2147483647; Execution Count:25 partially evaluated: max == 0 yes Evaluation Count:25 | no Evaluation Count:0 |
| 0-25 |
2991 | break; executed: break; Execution Count:25 | 25 |
2992 | | - |
2993 | case OP_CRRANGE: | - |
2994 | case OP_CRMINRANGE: | - |
2995 | minimize = (*ecode == OP_CRMINRANGE); never executed (the execution status of this line is deduced): minimize = (*ecode == OP_CRMINRANGE); | - |
2996 | min = GET2(ecode, 1); never executed (the execution status of this line is deduced): min = ecode[1]; | - |
2997 | max = GET2(ecode, 1 + IMM2_SIZE); never executed (the execution status of this line is deduced): max = ecode[1 + 1]; | - |
2998 | if (max == 0) max = INT_MAX; never executed: max = 2147483647; never evaluated: max == 0 | 0 |
2999 | ecode += 1 + 2 * IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 2 * 1; | - |
3000 | break; | 0 |
3001 | | - |
3002 | default: /* No repeat follows */ | - |
3003 | min = max = 1; never executed (the execution status of this line is deduced): min = max = 1; | - |
3004 | break; | 0 |
3005 | } | - |
3006 | | - |
3007 | /* First, ensure the minimum number of matches are present. */ | - |
3008 | | - |
3009 | for (i = 1; i <= min; i++) partially evaluated: i <= min no Evaluation Count:0 | yes Evaluation Count:25 |
| 0-25 |
3010 | { | - |
3011 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3012 | { | - |
3013 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3014 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3015 | } | - |
3016 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
3017 | if (!PRIV(xclass)(c, data, utf)) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: !_pcre16_xclass(c, data, utf) | 0 |
3018 | } | 0 |
3019 | | - |
3020 | /* If max == min we can continue with the main loop without the | - |
3021 | need to recurse. */ | - |
3022 | | - |
3023 | if (min == max) continue; never executed: continue; partially evaluated: min == max no Evaluation Count:0 | yes Evaluation Count:25 |
| 0-25 |
3024 | | - |
3025 | /* If minimizing, keep testing the rest of the expression and advancing | - |
3026 | the pointer while it matches the class. */ | - |
3027 | | - |
3028 | if (minimize) partially evaluated: minimize no Evaluation Count:0 | yes Evaluation Count:25 |
| 0-25 |
3029 | { | - |
3030 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
3031 | { | - |
3032 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM20); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3033 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3034 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
3035 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3036 | { | - |
3037 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3038 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3039 | } | - |
3040 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
3041 | if (!PRIV(xclass)(c, data, utf)) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: !_pcre16_xclass(c, data, utf) | 0 |
3042 | } | 0 |
3043 | /* Control never gets here */ | - |
3044 | } | 0 |
3045 | | - |
3046 | /* If maximizing, find the longest possible run, then work backwards. */ | - |
3047 | | - |
3048 | else | - |
3049 | { | - |
3050 | pp = eptr; executed (the execution status of this line is deduced): pp = eptr; | - |
3051 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:51 | no Evaluation Count:0 |
| 0-51 |
3052 | { | - |
3053 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
3054 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:10 | yes Evaluation Count:41 |
| 10-41 |
3055 | { | - |
3056 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:10 |
never evaluated: eptr > md->start_used_ptr | 0-10 |
3057 | break; executed: break; Execution Count:10 | 10 |
3058 | } | - |
3059 | #ifdef SUPPORT_UTF | - |
3060 | GETCHARLENTEST(c, eptr, len); executed: } Execution Count:15 partially evaluated: utf yes Evaluation Count:41 | no Evaluation Count:0 |
evaluated: (c & 0xfc00) == 0xd800 yes Evaluation Count:15 | yes Evaluation Count:26 |
| 0-41 |
3061 | #else | - |
3062 | c = *eptr; | - |
3063 | #endif | - |
3064 | if (!PRIV(xclass)(c, data, utf)) break; executed: break; Execution Count:15 evaluated: !_pcre16_xclass(c, data, utf) yes Evaluation Count:15 | yes Evaluation Count:26 |
| 15-26 |
3065 | eptr += len; executed (the execution status of this line is deduced): eptr += len; | - |
3066 | } executed: } Execution Count:26 | 26 |
3067 | for(;;) executed (the execution status of this line is deduced): for(;;) | - |
3068 | { | - |
3069 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM21); executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3070 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:15 evaluated: rrc != 0 yes Evaluation Count:15 | yes Evaluation Count:10 |
| 10-15 |
3071 | if (eptr-- == pp) break; /* Stop if tried at original pos */ executed: break; Execution Count:10 partially evaluated: eptr-- == pp yes Evaluation Count:10 | no Evaluation Count:0 |
| 0-10 |
3072 | #ifdef SUPPORT_UTF | - |
3073 | if (utf) BACKCHAR(eptr); never executed: eptr--; never evaluated: utf never evaluated: (*eptr & 0xfc00) == 0xdc00 | 0 |
3074 | #endif | - |
3075 | } | 0 |
3076 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:10 | 10 |
3077 | } | - |
3078 | | - |
3079 | /* Control never gets here */ | - |
3080 | } | - |
3081 | #endif /* End of XCLASS */ | - |
3082 | | - |
3083 | /* Match a single character, casefully */ | - |
3084 | | - |
3085 | case OP_CHAR: code before this statement never executed: case OP_CHAR: | 0 |
3086 | #ifdef SUPPORT_UTF | - |
3087 | if (utf) partially evaluated: utf yes Evaluation Count:2255 | no Evaluation Count:0 |
| 0-2255 |
3088 | { | - |
3089 | length = 1; executed (the execution status of this line is deduced): length = 1; | - |
3090 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
3091 | GETCHARLEN(fc, ecode, length); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:2255 |
| 0-2255 |
3092 | if (length > md->end_subject - eptr) evaluated: length > md->end_subject - eptr yes Evaluation Count:119 | yes Evaluation Count:2136 |
| 119-2136 |
3093 | { | - |
3094 | CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ executed: return (-12); Execution Count:7 executed: } Execution Count:9 evaluated: md->partial > 1 yes Evaluation Count:7 | yes Evaluation Count:9 |
evaluated: md->partial != 0 yes Evaluation Count:29 | yes Evaluation Count:90 |
partially evaluated: eptr >= md->end_subject yes Evaluation Count:29 | no Evaluation Count:0 |
evaluated: eptr > md->start_used_ptr yes Evaluation Count:16 | yes Evaluation Count:13 |
| 0-90 |
3095 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:112 | 112 |
3096 | } | - |
3097 | while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:156 evaluated: *ecode++ != *eptr++ yes Evaluation Count:156 | yes Evaluation Count:1980 |
evaluated: length-- > 0 yes Evaluation Count:2136 | yes Evaluation Count:1980 |
| 156-2136 |
3098 | } executed: } Execution Count:1980 | 1980 |
3099 | else | - |
3100 | #endif | - |
3101 | /* Not UTF mode */ | - |
3102 | { | - |
3103 | if (md->end_subject - eptr < 1) never evaluated: md->end_subject - eptr < 1 | 0 |
3104 | { | - |
3105 | SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3106 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3107 | } | - |
3108 | if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: ecode[1] != *eptr++ | 0 |
3109 | ecode += 2; never executed (the execution status of this line is deduced): ecode += 2; | - |
3110 | } | 0 |
3111 | break; executed: break; Execution Count:1980 | 1980 |
3112 | | - |
3113 | /* Match a single character, caselessly. If we are at the end of the | - |
3114 | subject, give up immediately. */ | - |
3115 | | - |
3116 | case OP_CHARI: | - |
3117 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:7 | yes Evaluation Count:577 |
| 7-577 |
3118 | { | - |
3119 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:7 |
never evaluated: eptr > md->start_used_ptr | 0-7 |
3120 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:7 | 7 |
3121 | } | - |
3122 | | - |
3123 | #ifdef SUPPORT_UTF | - |
3124 | if (utf) partially evaluated: utf yes Evaluation Count:577 | no Evaluation Count:0 |
| 0-577 |
3125 | { | - |
3126 | length = 1; executed (the execution status of this line is deduced): length = 1; | - |
3127 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
3128 | GETCHARLEN(fc, ecode, length); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:577 |
| 0-577 |
3129 | | - |
3130 | /* If the pattern character's value is < 128, we have only one byte, and | - |
3131 | we know that its other case must also be one byte long, so we can use the | - |
3132 | fast lookup table. We know that there is at least one byte left in the | - |
3133 | subject. */ | - |
3134 | | - |
3135 | if (fc < 128) evaluated: c < 128 yes Evaluation Count:576 | yes Evaluation Count:1 |
| 1-576 |
3136 | { | - |
3137 | if (md->lcc[fc] partially evaluated: md->lcc[c] != (((*eptr) <= 255u)? ((md->lcc)[*eptr]):(*eptr)) no Evaluation Count:0 | yes Evaluation Count:576 |
| 0-576 |
3138 | != TABLE_GET(*eptr, md->lcc, *eptr)) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: md->lcc[c] != (((*eptr) <= 255u)? ((md->lcc)[*eptr]):(*eptr)) no Evaluation Count:0 | yes Evaluation Count:576 |
partially evaluated: ((*eptr) <= 255u) yes Evaluation Count:576 | no Evaluation Count:0 |
| 0-576 |
3139 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
3140 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
3141 | } executed: } Execution Count:576 | 576 |
3142 | | - |
3143 | /* Otherwise we must pick up the subject character. Note that we cannot | - |
3144 | use the value of "length" to check for sufficient bytes left, because the | - |
3145 | other case of the character may have more or fewer bytes. */ | - |
3146 | | - |
3147 | else | - |
3148 | { | - |
3149 | unsigned int dc; executed (the execution status of this line is deduced): unsigned int dc; | - |
3150 | GETCHARINC(dc, eptr); never executed: } partially evaluated: (dc & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3151 | ecode += length; executed (the execution status of this line is deduced): ecode += length; | - |
3152 | | - |
3153 | /* If we have Unicode property support, we can use it to test the other | - |
3154 | case of the character, if there is one. */ | - |
3155 | | - |
3156 | if (fc != dc) partially evaluated: c != dc yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3157 | { | - |
3158 | #ifdef SUPPORT_UCP | - |
3159 | if (dc != UCD_OTHERCASE(fc)) partially evaluated: dc != (c + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->other_case) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3160 | #endif | - |
3161 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3162 | } executed: } Execution Count:1 | 1 |
3163 | } executed: } Execution Count:1 | 1 |
3164 | } | - |
3165 | else | - |
3166 | #endif /* SUPPORT_UTF */ | - |
3167 | | - |
3168 | /* Not UTF mode */ | - |
3169 | { | - |
3170 | if (TABLE_GET(ecode[1], md->lcc, ecode[1]) never evaluated: (((ecode[1]) <= 255u)? ((md->lcc)[ecode[1]]):(ecode[1])) != (((*eptr) <= 255u)? ((md->lcc)[*eptr]):(*eptr)) never evaluated: ((ecode[1]) <= 255u) | 0 |
3171 | != TABLE_GET(*eptr, md->lcc, *eptr)) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: (((ecode[1]) <= 255u)? ((md->lcc)[ecode[1]]):(ecode[1])) != (((*eptr) <= 255u)? ((md->lcc)[*eptr]):(*eptr)) never evaluated: ((*eptr) <= 255u) | 0 |
3172 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
3173 | ecode += 2; never executed (the execution status of this line is deduced): ecode += 2; | - |
3174 | } | 0 |
3175 | break; executed: break; Execution Count:577 | 577 |
3176 | | - |
3177 | /* Match a single character repeatedly. */ | - |
3178 | | - |
3179 | case OP_EXACT: | - |
3180 | case OP_EXACTI: | - |
3181 | min = max = GET2(ecode, 1); never executed (the execution status of this line is deduced): min = max = ecode[1]; | - |
3182 | ecode += 1 + IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
3183 | goto REPEATCHAR; never executed: goto REPEATCHAR; | 0 |
3184 | | - |
3185 | case OP_POSUPTO: | - |
3186 | case OP_POSUPTOI: | - |
3187 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3188 | /* Fall through */ | - |
3189 | | - |
3190 | case OP_UPTO: code before this statement never executed: case OP_UPTO: | 0 |
3191 | case OP_UPTOI: | - |
3192 | case OP_MINUPTO: | - |
3193 | case OP_MINUPTOI: | - |
3194 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3195 | max = GET2(ecode, 1); never executed (the execution status of this line is deduced): max = ecode[1]; | - |
3196 | minimize = *ecode == OP_MINUPTO || *ecode == OP_MINUPTOI; never evaluated: *ecode == OP_MINUPTO never evaluated: *ecode == OP_MINUPTOI | 0 |
3197 | ecode += 1 + IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
3198 | goto REPEATCHAR; never executed: goto REPEATCHAR; | 0 |
3199 | | - |
3200 | case OP_POSSTAR: | - |
3201 | case OP_POSSTARI: | - |
3202 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3203 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3204 | max = INT_MAX; never executed (the execution status of this line is deduced): max = 2147483647; | - |
3205 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3206 | goto REPEATCHAR; never executed: goto REPEATCHAR; | 0 |
3207 | | - |
3208 | case OP_POSPLUS: | - |
3209 | case OP_POSPLUSI: | - |
3210 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3211 | min = 1; never executed (the execution status of this line is deduced): min = 1; | - |
3212 | max = INT_MAX; never executed (the execution status of this line is deduced): max = 2147483647; | - |
3213 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3214 | goto REPEATCHAR; never executed: goto REPEATCHAR; | 0 |
3215 | | - |
3216 | case OP_POSQUERY: | - |
3217 | case OP_POSQUERYI: | - |
3218 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3219 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3220 | max = 1; never executed (the execution status of this line is deduced): max = 1; | - |
3221 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3222 | goto REPEATCHAR; never executed: goto REPEATCHAR; | 0 |
3223 | | - |
3224 | case OP_STAR: | - |
3225 | case OP_STARI: | - |
3226 | case OP_MINSTAR: | - |
3227 | case OP_MINSTARI: | - |
3228 | case OP_PLUS: | - |
3229 | case OP_PLUSI: | - |
3230 | case OP_MINPLUS: | - |
3231 | case OP_MINPLUSI: | - |
3232 | case OP_QUERY: | - |
3233 | case OP_QUERYI: | - |
3234 | case OP_MINQUERY: | - |
3235 | case OP_MINQUERYI: | - |
3236 | c = *ecode++ - ((op < OP_STARI)? OP_STAR : OP_STARI); partially evaluated: (op < OP_STARI) yes Evaluation Count:41 | no Evaluation Count:0 |
| 0-41 |
3237 | minimize = (c & 1) != 0; executed (the execution status of this line is deduced): minimize = (c & 1) != 0; | - |
3238 | min = rep_min[c]; /* Pick up values from tables; */ executed (the execution status of this line is deduced): min = rep_min[c]; | - |
3239 | max = rep_max[c]; /* zero for max => infinity */ executed (the execution status of this line is deduced): max = rep_max[c]; | - |
3240 | if (max == 0) max = INT_MAX; executed: max = 2147483647; Execution Count:41 partially evaluated: max == 0 yes Evaluation Count:41 | no Evaluation Count:0 |
| 0-41 |
3241 | | - |
3242 | /* Common code for all repeated single-character matches. */ | - |
3243 | | - |
3244 | REPEATCHAR: code before this statement executed: REPEATCHAR: Execution Count:41 | 41 |
3245 | #ifdef SUPPORT_UTF | - |
3246 | if (utf) partially evaluated: utf yes Evaluation Count:41 | no Evaluation Count:0 |
| 0-41 |
3247 | { | - |
3248 | length = 1; executed (the execution status of this line is deduced): length = 1; | - |
3249 | charptr = ecode; executed (the execution status of this line is deduced): charptr = ecode; | - |
3250 | GETCHARLEN(fc, ecode, length); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
3251 | ecode += length; executed (the execution status of this line is deduced): ecode += length; | - |
3252 | | - |
3253 | /* Handle multibyte character matching specially here. There is | - |
3254 | support for caseless matching if UCP support is present. */ | - |
3255 | | - |
3256 | if (length > 1) partially evaluated: length > 1 no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
3257 | { | - |
3258 | #ifdef SUPPORT_UCP | - |
3259 | unsigned int othercase; never executed (the execution status of this line is deduced): unsigned int othercase; | - |
3260 | if (op >= OP_STARI && /* Caseless */ never evaluated: op >= OP_STARI | 0 |
3261 | (othercase = UCD_OTHERCASE(fc)) != fc) never evaluated: (othercase = (c + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->other_case)) != c | 0 |
3262 | oclength = PRIV(ord2utf)(othercase, occhars); never executed: oclength = _pcre16_ord2utf(othercase, occhars); | 0 |
3263 | else oclength = 0; never executed: oclength = 0; | 0 |
3264 | #endif /* SUPPORT_UCP */ | - |
3265 | | - |
3266 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
3267 | { | - |
3268 | if (eptr <= md->end_subject - length && never evaluated: eptr <= md->end_subject - length | 0 |
3269 | memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length; never executed: eptr += length; never evaluated: memcmp(eptr, charptr, ((length) << 1)) == 0 | 0 |
3270 | #ifdef SUPPORT_UCP | - |
3271 | else if (oclength > 0 && never evaluated: oclength > 0 | 0 |
3272 | eptr <= md->end_subject - oclength && never evaluated: eptr <= md->end_subject - oclength | 0 |
3273 | memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength; never executed: eptr += oclength; never evaluated: memcmp(eptr, occhars, ((oclength) << 1)) == 0 | 0 |
3274 | #endif /* SUPPORT_UCP */ | - |
3275 | else | - |
3276 | { | - |
3277 | CHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr >= md->end_subject never evaluated: eptr > md->start_used_ptr | 0 |
3278 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3279 | } | - |
3280 | } | - |
3281 | | - |
3282 | if (min == max) continue; never executed: continue; never evaluated: min == max | 0 |
3283 | | - |
3284 | if (minimize) never evaluated: minimize | 0 |
3285 | { | - |
3286 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
3287 | { | - |
3288 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM22); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3289 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3290 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
3291 | if (eptr <= md->end_subject - length && never evaluated: eptr <= md->end_subject - length | 0 |
3292 | memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length; never executed: eptr += length; never evaluated: memcmp(eptr, charptr, ((length) << 1)) == 0 | 0 |
3293 | #ifdef SUPPORT_UCP | - |
3294 | else if (oclength > 0 && never evaluated: oclength > 0 | 0 |
3295 | eptr <= md->end_subject - oclength && never evaluated: eptr <= md->end_subject - oclength | 0 |
3296 | memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength; never executed: eptr += oclength; never evaluated: memcmp(eptr, occhars, ((oclength) << 1)) == 0 | 0 |
3297 | #endif /* SUPPORT_UCP */ | - |
3298 | else | - |
3299 | { | - |
3300 | CHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr >= md->end_subject never evaluated: eptr > md->start_used_ptr | 0 |
3301 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3302 | } | - |
3303 | } | - |
3304 | /* Control never gets here */ | - |
3305 | } | 0 |
3306 | | - |
3307 | else /* Maximize */ | - |
3308 | { | - |
3309 | pp = eptr; never executed (the execution status of this line is deduced): pp = eptr; | - |
3310 | for (i = min; i < max; i++) | 0 |
3311 | { | - |
3312 | if (eptr <= md->end_subject - length && never evaluated: eptr <= md->end_subject - length | 0 |
3313 | memcmp(eptr, charptr, IN_UCHARS(length)) == 0) eptr += length; never executed: eptr += length; never evaluated: memcmp(eptr, charptr, ((length) << 1)) == 0 | 0 |
3314 | #ifdef SUPPORT_UCP | - |
3315 | else if (oclength > 0 && never evaluated: oclength > 0 | 0 |
3316 | eptr <= md->end_subject - oclength && never evaluated: eptr <= md->end_subject - oclength | 0 |
3317 | memcmp(eptr, occhars, IN_UCHARS(oclength)) == 0) eptr += oclength; never executed: eptr += oclength; never evaluated: memcmp(eptr, occhars, ((oclength) << 1)) == 0 | 0 |
3318 | #endif /* SUPPORT_UCP */ | - |
3319 | else | - |
3320 | { | - |
3321 | CHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr >= md->end_subject never evaluated: eptr > md->start_used_ptr | 0 |
3322 | break; | 0 |
3323 | } | - |
3324 | } | - |
3325 | | - |
3326 | if (possessive) continue; never executed: continue; never evaluated: possessive | 0 |
3327 | | - |
3328 | for(;;) never executed (the execution status of this line is deduced): for(;;) | - |
3329 | { | - |
3330 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM23); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3331 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3332 | if (eptr == pp) { RRETURN(MATCH_NOMATCH); } never executed: return 0; never evaluated: eptr == pp | 0 |
3333 | #ifdef SUPPORT_UCP | - |
3334 | eptr--; never executed (the execution status of this line is deduced): eptr--; | - |
3335 | BACKCHAR(eptr); never executed: eptr--; never evaluated: (*eptr & 0xfc00) == 0xdc00 | 0 |
3336 | #else /* without SUPPORT_UCP */ | - |
3337 | eptr -= length; | - |
3338 | #endif /* SUPPORT_UCP */ | - |
3339 | } | 0 |
3340 | } | 0 |
3341 | /* Control never gets here */ | - |
3342 | } | - |
3343 | | - |
3344 | /* If the length of a UTF-8 character is 1, we fall through here, and | - |
3345 | obey the code as for non-UTF-8 characters below, though in this case the | - |
3346 | value of fc will always be < 128. */ | - |
3347 | } executed: } Execution Count:41 | 41 |
3348 | else | - |
3349 | #endif /* SUPPORT_UTF */ | - |
3350 | /* When not in UTF-8 mode, load a single-byte character. */ | - |
3351 | fc = *ecode++; never executed: c = *ecode++; | 0 |
3352 | | - |
3353 | /* The value of fc at this point is always one character, though we may | - |
3354 | or may not be in UTF mode. The code is duplicated for the caseless and | - |
3355 | caseful cases, for speed, since matching characters is likely to be quite | - |
3356 | common. First, ensure the minimum number of matches are present. If min = | - |
3357 | max, continue at the same level without recursing. Otherwise, if | - |
3358 | minimizing, keep trying the rest of the expression and advancing one | - |
3359 | matching character if failing, up to the maximum. Alternatively, if | - |
3360 | maximizing, find the maximum number of characters and work backwards. */ | - |
3361 | | - |
3362 | DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max, | - |
3363 | max, eptr)); | - |
3364 | | - |
3365 | if (op >= OP_STARI) /* Caseless */ partially evaluated: op >= OP_STARI no Evaluation Count:0 | yes Evaluation Count:41 |
| 0-41 |
3366 | { | - |
3367 | #ifdef COMPILE_PCRE8 | - |
3368 | /* fc must be < 128 if UTF is enabled. */ | - |
3369 | foc = md->fcc[fc]; | - |
3370 | #else | - |
3371 | #ifdef SUPPORT_UTF | - |
3372 | #ifdef SUPPORT_UCP | - |
3373 | if (utf && fc > 127) never evaluated: utf never evaluated: c > 127 | 0 |
3374 | foc = UCD_OTHERCASE(fc); never executed: number = (c + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->other_case); | 0 |
3375 | #else | - |
3376 | if (utf && fc > 127) | - |
3377 | foc = fc; | - |
3378 | #endif /* SUPPORT_UCP */ | - |
3379 | else | - |
3380 | #endif /* SUPPORT_UTF */ | - |
3381 | foc = TABLE_GET(fc, md->fcc, fc); never executed: number = (((c) <= 255u)? ((md->fcc)[c]):(c)); never evaluated: ((c) <= 255u) | 0 |
3382 | #endif /* COMPILE_PCRE8 */ | - |
3383 | | - |
3384 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
3385 | { | - |
3386 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3387 | { | - |
3388 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3389 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3390 | } | - |
3391 | if (fc != *eptr && foc != *eptr) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c != *eptr never evaluated: number != *eptr | 0 |
3392 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
3393 | } | 0 |
3394 | if (min == max) continue; never executed: continue; never evaluated: min == max | 0 |
3395 | if (minimize) never evaluated: minimize | 0 |
3396 | { | - |
3397 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
3398 | { | - |
3399 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM24); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3400 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3401 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
3402 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3403 | { | - |
3404 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3405 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3406 | } | - |
3407 | if (fc != *eptr && foc != *eptr) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c != *eptr never evaluated: number != *eptr | 0 |
3408 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
3409 | } | 0 |
3410 | /* Control never gets here */ | - |
3411 | } | 0 |
3412 | else /* Maximize */ | - |
3413 | { | - |
3414 | pp = eptr; never executed (the execution status of this line is deduced): pp = eptr; | - |
3415 | for (i = min; i < max; i++) | 0 |
3416 | { | - |
3417 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3418 | { | - |
3419 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3420 | break; | 0 |
3421 | } | - |
3422 | if (fc != *eptr && foc != *eptr) break; never executed: break; never evaluated: c != *eptr never evaluated: number != *eptr | 0 |
3423 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
3424 | } | 0 |
3425 | | - |
3426 | if (possessive) continue; never executed: continue; never evaluated: possessive | 0 |
3427 | | - |
3428 | while (eptr >= pp) never evaluated: eptr >= pp | 0 |
3429 | { | - |
3430 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM25); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3431 | eptr--; never executed (the execution status of this line is deduced): eptr--; | - |
3432 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3433 | } | 0 |
3434 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3435 | } | - |
3436 | /* Control never gets here */ | - |
3437 | } | - |
3438 | | - |
3439 | /* Caseful comparisons (includes all multi-byte characters) */ | - |
3440 | | - |
3441 | else | - |
3442 | { | - |
3443 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:7 | yes Evaluation Count:39 |
| 7-39 |
3444 | { | - |
3445 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:2 | yes Evaluation Count:5 |
| 2-5 |
3446 | { | - |
3447 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: eptr > md->start_used_ptr | 0-2 |
3448 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:2 | 2 |
3449 | } | - |
3450 | if (fc != *eptr++) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: c != *eptr++ no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
3451 | } executed: } Execution Count:5 | 5 |
3452 | | - |
3453 | if (min == max) continue; never executed: continue; partially evaluated: min == max no Evaluation Count:0 | yes Evaluation Count:39 |
| 0-39 |
3454 | | - |
3455 | if (minimize) partially evaluated: minimize no Evaluation Count:0 | yes Evaluation Count:39 |
| 0-39 |
3456 | { | - |
3457 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
3458 | { | - |
3459 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM26); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3460 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3461 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
3462 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3463 | { | - |
3464 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3465 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3466 | } | - |
3467 | if (fc != *eptr++) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c != *eptr++ | 0 |
3468 | } | 0 |
3469 | /* Control never gets here */ | - |
3470 | } | 0 |
3471 | else /* Maximize */ | - |
3472 | { | - |
3473 | pp = eptr; executed (the execution status of this line is deduced): pp = eptr; | - |
3474 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:66 | no Evaluation Count:0 |
| 0-66 |
3475 | { | - |
3476 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:9 | yes Evaluation Count:57 |
| 9-57 |
3477 | { | - |
3478 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:9 |
never evaluated: eptr > md->start_used_ptr | 0-9 |
3479 | break; executed: break; Execution Count:9 | 9 |
3480 | } | - |
3481 | if (fc != *eptr) break; executed: break; Execution Count:30 evaluated: c != *eptr yes Evaluation Count:30 | yes Evaluation Count:27 |
| 27-30 |
3482 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
3483 | } executed: } Execution Count:27 | 27 |
3484 | if (possessive) continue; never executed: continue; partially evaluated: possessive no Evaluation Count:0 | yes Evaluation Count:39 |
| 0-39 |
3485 | | - |
3486 | while (eptr >= pp) evaluated: eptr >= pp yes Evaluation Count:39 | yes Evaluation Count:16 |
| 16-39 |
3487 | { | - |
3488 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM27); executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3489 | eptr--; executed (the execution status of this line is deduced): eptr--; | - |
3490 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:23 evaluated: rrc != 0 yes Evaluation Count:23 | yes Evaluation Count:16 |
| 16-23 |
3491 | } executed: } Execution Count:16 | 16 |
3492 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:16 | 16 |
3493 | } | - |
3494 | } | - |
3495 | /* Control never gets here */ | - |
3496 | | - |
3497 | /* Match a negated single one-byte character. The character we are | - |
3498 | checking can be multibyte. */ | - |
3499 | | - |
3500 | case OP_NOT: code before this statement never executed: case OP_NOT: | 0 |
3501 | case OP_NOTI: | - |
3502 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3503 | { | - |
3504 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3505 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3506 | } | - |
3507 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3508 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
3509 | if (op == OP_NOTI) /* The caseless case */ never evaluated: op == OP_NOTI | 0 |
3510 | { | - |
3511 | register unsigned int ch, och; never executed (the execution status of this line is deduced): register unsigned int ch, och; | - |
3512 | ch = *ecode++; never executed (the execution status of this line is deduced): ch = *ecode++; | - |
3513 | #ifdef COMPILE_PCRE8 | - |
3514 | /* ch must be < 128 if UTF is enabled. */ | - |
3515 | och = md->fcc[ch]; | - |
3516 | #else | - |
3517 | #ifdef SUPPORT_UTF | - |
3518 | #ifdef SUPPORT_UCP | - |
3519 | if (utf && ch > 127) never evaluated: utf never evaluated: ch > 127 | 0 |
3520 | och = UCD_OTHERCASE(ch); never executed: och = (ch + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(ch) / 128] * 128 + (ch) % 128])->other_case); | 0 |
3521 | #else | - |
3522 | if (utf && ch > 127) | - |
3523 | och = ch; | - |
3524 | #endif /* SUPPORT_UCP */ | - |
3525 | else | - |
3526 | #endif /* SUPPORT_UTF */ | - |
3527 | och = TABLE_GET(ch, md->fcc, ch); never executed: och = (((ch) <= 255u)? ((md->fcc)[ch]):(ch)); never evaluated: ((ch) <= 255u) | 0 |
3528 | #endif /* COMPILE_PCRE8 */ | - |
3529 | if (ch == c || och == c) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: ch == c never evaluated: och == c | 0 |
3530 | } | 0 |
3531 | else /* Caseful */ | - |
3532 | { | - |
3533 | if (*ecode++ == c) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: *ecode++ == c | 0 |
3534 | } | 0 |
3535 | break; | 0 |
3536 | | - |
3537 | /* Match a negated single one-byte character repeatedly. This is almost a | - |
3538 | repeat of the code for a repeated single character, but I haven't found a | - |
3539 | nice way of commoning these up that doesn't require a test of the | - |
3540 | positive/negative option for each character match. Maybe that wouldn't add | - |
3541 | very much to the time taken, but character matching *is* what this is all | - |
3542 | about... */ | - |
3543 | | - |
3544 | case OP_NOTEXACT: | - |
3545 | case OP_NOTEXACTI: | - |
3546 | min = max = GET2(ecode, 1); never executed (the execution status of this line is deduced): min = max = ecode[1]; | - |
3547 | ecode += 1 + IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
3548 | goto REPEATNOTCHAR; never executed: goto REPEATNOTCHAR; | 0 |
3549 | | - |
3550 | case OP_NOTUPTO: | - |
3551 | case OP_NOTUPTOI: | - |
3552 | case OP_NOTMINUPTO: | - |
3553 | case OP_NOTMINUPTOI: | - |
3554 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3555 | max = GET2(ecode, 1); never executed (the execution status of this line is deduced): max = ecode[1]; | - |
3556 | minimize = *ecode == OP_NOTMINUPTO || *ecode == OP_NOTMINUPTOI; never evaluated: *ecode == OP_NOTMINUPTO never evaluated: *ecode == OP_NOTMINUPTOI | 0 |
3557 | ecode += 1 + IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
3558 | goto REPEATNOTCHAR; never executed: goto REPEATNOTCHAR; | 0 |
3559 | | - |
3560 | case OP_NOTPOSSTAR: | - |
3561 | case OP_NOTPOSSTARI: | - |
3562 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3563 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3564 | max = INT_MAX; never executed (the execution status of this line is deduced): max = 2147483647; | - |
3565 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3566 | goto REPEATNOTCHAR; never executed: goto REPEATNOTCHAR; | 0 |
3567 | | - |
3568 | case OP_NOTPOSPLUS: | - |
3569 | case OP_NOTPOSPLUSI: | - |
3570 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3571 | min = 1; never executed (the execution status of this line is deduced): min = 1; | - |
3572 | max = INT_MAX; never executed (the execution status of this line is deduced): max = 2147483647; | - |
3573 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3574 | goto REPEATNOTCHAR; never executed: goto REPEATNOTCHAR; | 0 |
3575 | | - |
3576 | case OP_NOTPOSQUERY: | - |
3577 | case OP_NOTPOSQUERYI: | - |
3578 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3579 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3580 | max = 1; never executed (the execution status of this line is deduced): max = 1; | - |
3581 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3582 | goto REPEATNOTCHAR; never executed: goto REPEATNOTCHAR; | 0 |
3583 | | - |
3584 | case OP_NOTPOSUPTO: | - |
3585 | case OP_NOTPOSUPTOI: | - |
3586 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3587 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3588 | max = GET2(ecode, 1); never executed (the execution status of this line is deduced): max = ecode[1]; | - |
3589 | ecode += 1 + IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
3590 | goto REPEATNOTCHAR; never executed: goto REPEATNOTCHAR; | 0 |
3591 | | - |
3592 | case OP_NOTSTAR: | - |
3593 | case OP_NOTSTARI: | - |
3594 | case OP_NOTMINSTAR: | - |
3595 | case OP_NOTMINSTARI: | - |
3596 | case OP_NOTPLUS: | - |
3597 | case OP_NOTPLUSI: | - |
3598 | case OP_NOTMINPLUS: | - |
3599 | case OP_NOTMINPLUSI: | - |
3600 | case OP_NOTQUERY: | - |
3601 | case OP_NOTQUERYI: | - |
3602 | case OP_NOTMINQUERY: | - |
3603 | case OP_NOTMINQUERYI: | - |
3604 | c = *ecode++ - ((op >= OP_NOTSTARI)? OP_NOTSTARI: OP_NOTSTAR); partially evaluated: (op >= OP_NOTSTARI) no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3605 | minimize = (c & 1) != 0; executed (the execution status of this line is deduced): minimize = (c & 1) != 0; | - |
3606 | min = rep_min[c]; /* Pick up values from tables; */ executed (the execution status of this line is deduced): min = rep_min[c]; | - |
3607 | max = rep_max[c]; /* zero for max => infinity */ executed (the execution status of this line is deduced): max = rep_max[c]; | - |
3608 | if (max == 0) max = INT_MAX; executed: max = 2147483647; Execution Count:1 partially evaluated: max == 0 yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3609 | | - |
3610 | /* Common code for all repeated single-byte matches. */ | - |
3611 | | - |
3612 | REPEATNOTCHAR: code before this statement executed: REPEATNOTCHAR: Execution Count:1 | 1 |
3613 | fc = *ecode++; executed (the execution status of this line is deduced): c = *ecode++; | - |
3614 | | - |
3615 | /* The code is duplicated for the caseless and caseful cases, for speed, | - |
3616 | since matching characters is likely to be quite common. First, ensure the | - |
3617 | minimum number of matches are present. If min = max, continue at the same | - |
3618 | level without recursing. Otherwise, if minimizing, keep trying the rest of | - |
3619 | the expression and advancing one matching character if failing, up to the | - |
3620 | maximum. Alternatively, if maximizing, find the maximum number of | - |
3621 | characters and work backwards. */ | - |
3622 | | - |
3623 | DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max, | - |
3624 | max, eptr)); | - |
3625 | | - |
3626 | if (op >= OP_NOTSTARI) /* Caseless */ partially evaluated: op >= OP_NOTSTARI no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3627 | { | - |
3628 | #ifdef COMPILE_PCRE8 | - |
3629 | /* fc must be < 128 if UTF is enabled. */ | - |
3630 | foc = md->fcc[fc]; | - |
3631 | #else | - |
3632 | #ifdef SUPPORT_UTF | - |
3633 | #ifdef SUPPORT_UCP | - |
3634 | if (utf && fc > 127) never evaluated: utf never evaluated: c > 127 | 0 |
3635 | foc = UCD_OTHERCASE(fc); never executed: number = (c + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->other_case); | 0 |
3636 | #else | - |
3637 | if (utf && fc > 127) | - |
3638 | foc = fc; | - |
3639 | #endif /* SUPPORT_UCP */ | - |
3640 | else | - |
3641 | #endif /* SUPPORT_UTF */ | - |
3642 | foc = TABLE_GET(fc, md->fcc, fc); never executed: number = (((c) <= 255u)? ((md->fcc)[c]):(c)); never evaluated: ((c) <= 255u) | 0 |
3643 | #endif /* COMPILE_PCRE8 */ | - |
3644 | | - |
3645 | #ifdef SUPPORT_UTF | - |
3646 | if (utf) | 0 |
3647 | { | - |
3648 | register unsigned int d; never executed (the execution status of this line is deduced): register unsigned int d; | - |
3649 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
3650 | { | - |
3651 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3652 | { | - |
3653 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3654 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3655 | } | - |
3656 | GETCHARINC(d, eptr); never executed: } never evaluated: (d & 0xfc00) == 0xd800 | 0 |
3657 | if (fc == d || (unsigned int) foc == d) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c == d never evaluated: (unsigned int) number == d | 0 |
3658 | } | 0 |
3659 | } | 0 |
3660 | else | - |
3661 | #endif | - |
3662 | /* Not UTF mode */ | - |
3663 | { | - |
3664 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
3665 | { | - |
3666 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3667 | { | - |
3668 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3669 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3670 | } | - |
3671 | if (fc == *eptr || foc == *eptr) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c == *eptr never evaluated: number == *eptr | 0 |
3672 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
3673 | } | 0 |
3674 | } | 0 |
3675 | | - |
3676 | if (min == max) continue; never executed: continue; never evaluated: min == max | 0 |
3677 | | - |
3678 | if (minimize) never evaluated: minimize | 0 |
3679 | { | - |
3680 | #ifdef SUPPORT_UTF | - |
3681 | if (utf) | 0 |
3682 | { | - |
3683 | register unsigned int d; never executed (the execution status of this line is deduced): register unsigned int d; | - |
3684 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
3685 | { | - |
3686 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM28); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3687 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3688 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
3689 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3690 | { | - |
3691 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3692 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3693 | } | - |
3694 | GETCHARINC(d, eptr); never executed: } never evaluated: (d & 0xfc00) == 0xd800 | 0 |
3695 | if (fc == d || (unsigned int)foc == d) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c == d never evaluated: (unsigned int)number == d | 0 |
3696 | } | 0 |
3697 | } | 0 |
3698 | else | - |
3699 | #endif | - |
3700 | /* Not UTF mode */ | - |
3701 | { | - |
3702 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
3703 | { | - |
3704 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM29); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3705 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3706 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
3707 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3708 | { | - |
3709 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3710 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3711 | } | - |
3712 | if (fc == *eptr || foc == *eptr) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c == *eptr never evaluated: number == *eptr | 0 |
3713 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
3714 | } | 0 |
3715 | } | 0 |
3716 | /* Control never gets here */ | - |
3717 | } | - |
3718 | | - |
3719 | /* Maximize case */ | - |
3720 | | - |
3721 | else | - |
3722 | { | - |
3723 | pp = eptr; never executed (the execution status of this line is deduced): pp = eptr; | - |
3724 | | - |
3725 | #ifdef SUPPORT_UTF | - |
3726 | if (utf) | 0 |
3727 | { | - |
3728 | register unsigned int d; never executed (the execution status of this line is deduced): register unsigned int d; | - |
3729 | for (i = min; i < max; i++) | 0 |
3730 | { | - |
3731 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
3732 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3733 | { | - |
3734 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3735 | break; | 0 |
3736 | } | - |
3737 | GETCHARLEN(d, eptr, len); never executed: } never evaluated: (d & 0xfc00) == 0xd800 | 0 |
3738 | if (fc == d || (unsigned int)foc == d) break; never executed: break; never evaluated: c == d never evaluated: (unsigned int)number == d | 0 |
3739 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
3740 | } | 0 |
3741 | if (possessive) continue; never executed: continue; never evaluated: possessive | 0 |
3742 | for(;;) never executed (the execution status of this line is deduced): for(;;) | - |
3743 | { | - |
3744 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM30); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3745 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3746 | if (eptr-- == pp) break; /* Stop if tried at original pos */ never executed: break; never evaluated: eptr-- == pp | 0 |
3747 | BACKCHAR(eptr); never executed: eptr--; never evaluated: (*eptr & 0xfc00) == 0xdc00 | 0 |
3748 | } | 0 |
3749 | } | 0 |
3750 | else | - |
3751 | #endif | - |
3752 | /* Not UTF mode */ | - |
3753 | { | - |
3754 | for (i = min; i < max; i++) | 0 |
3755 | { | - |
3756 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3757 | { | - |
3758 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3759 | break; | 0 |
3760 | } | - |
3761 | if (fc == *eptr || foc == *eptr) break; never executed: break; never evaluated: c == *eptr never evaluated: number == *eptr | 0 |
3762 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
3763 | } | 0 |
3764 | if (possessive) continue; never executed: continue; never evaluated: possessive | 0 |
3765 | while (eptr >= pp) never evaluated: eptr >= pp | 0 |
3766 | { | - |
3767 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM31); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3768 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3769 | eptr--; never executed (the execution status of this line is deduced): eptr--; | - |
3770 | } | 0 |
3771 | } | 0 |
3772 | | - |
3773 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3774 | } | - |
3775 | /* Control never gets here */ | - |
3776 | } | - |
3777 | | - |
3778 | /* Caseful comparisons */ | - |
3779 | | - |
3780 | else | - |
3781 | { | - |
3782 | #ifdef SUPPORT_UTF | - |
3783 | if (utf) partially evaluated: utf yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3784 | { | - |
3785 | register unsigned int d; executed (the execution status of this line is deduced): register unsigned int d; | - |
3786 | for (i = 1; i <= min; i++) partially evaluated: i <= min no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3787 | { | - |
3788 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3789 | { | - |
3790 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3791 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3792 | } | - |
3793 | GETCHARINC(d, eptr); never executed: } never evaluated: (d & 0xfc00) == 0xd800 | 0 |
3794 | if (fc == d) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c == d | 0 |
3795 | } | 0 |
3796 | } executed: } Execution Count:1 | 1 |
3797 | else | - |
3798 | #endif | - |
3799 | /* Not UTF mode */ | - |
3800 | { | - |
3801 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
3802 | { | - |
3803 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3804 | { | - |
3805 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3806 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3807 | } | - |
3808 | if (fc == *eptr++) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c == *eptr++ | 0 |
3809 | } | 0 |
3810 | } | 0 |
3811 | | - |
3812 | if (min == max) continue; never executed: continue; partially evaluated: min == max no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3813 | | - |
3814 | if (minimize) partially evaluated: minimize no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3815 | { | - |
3816 | #ifdef SUPPORT_UTF | - |
3817 | if (utf) | 0 |
3818 | { | - |
3819 | register unsigned int d; never executed (the execution status of this line is deduced): register unsigned int d; | - |
3820 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
3821 | { | - |
3822 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM32); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3823 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3824 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
3825 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3826 | { | - |
3827 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3828 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3829 | } | - |
3830 | GETCHARINC(d, eptr); never executed: } never evaluated: (d & 0xfc00) == 0xd800 | 0 |
3831 | if (fc == d) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c == d | 0 |
3832 | } | 0 |
3833 | } | 0 |
3834 | else | - |
3835 | #endif | - |
3836 | /* Not UTF mode */ | - |
3837 | { | - |
3838 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
3839 | { | - |
3840 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM33); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3841 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3842 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
3843 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3844 | { | - |
3845 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3846 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3847 | } | - |
3848 | if (fc == *eptr++) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: c == *eptr++ | 0 |
3849 | } | 0 |
3850 | } | 0 |
3851 | /* Control never gets here */ | - |
3852 | } | - |
3853 | | - |
3854 | /* Maximize case */ | - |
3855 | | - |
3856 | else | - |
3857 | { | - |
3858 | pp = eptr; executed (the execution status of this line is deduced): pp = eptr; | - |
3859 | | - |
3860 | #ifdef SUPPORT_UTF | - |
3861 | if (utf) partially evaluated: utf yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3862 | { | - |
3863 | register unsigned int d; executed (the execution status of this line is deduced): register unsigned int d; | - |
3864 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
3865 | { | - |
3866 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
3867 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
3868 | { | - |
3869 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3870 | break; | 0 |
3871 | } | - |
3872 | GETCHARLEN(d, eptr, len); never executed: } partially evaluated: (d & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:8 |
| 0-8 |
3873 | if (fc == d) break; executed: break; Execution Count:1 evaluated: c == d yes Evaluation Count:1 | yes Evaluation Count:7 |
| 1-7 |
3874 | eptr += len; executed (the execution status of this line is deduced): eptr += len; | - |
3875 | } executed: } Execution Count:7 | 7 |
3876 | if (possessive) continue; never executed: continue; partially evaluated: possessive no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3877 | for(;;) executed (the execution status of this line is deduced): for(;;) | - |
3878 | { | - |
3879 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM34); executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3880 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:1 partially evaluated: rrc != 0 yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
3881 | if (eptr-- == pp) break; /* Stop if tried at original pos */ never executed: break; never evaluated: eptr-- == pp | 0 |
3882 | BACKCHAR(eptr); never executed: eptr--; never evaluated: (*eptr & 0xfc00) == 0xdc00 | 0 |
3883 | } | 0 |
3884 | } | 0 |
3885 | else | - |
3886 | #endif | - |
3887 | /* Not UTF mode */ | - |
3888 | { | - |
3889 | for (i = min; i < max; i++) | 0 |
3890 | { | - |
3891 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
3892 | { | - |
3893 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
3894 | break; | 0 |
3895 | } | - |
3896 | if (fc == *eptr) break; never executed: break; never evaluated: c == *eptr | 0 |
3897 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
3898 | } | 0 |
3899 | if (possessive) continue; never executed: continue; never evaluated: possessive | 0 |
3900 | while (eptr >= pp) never evaluated: eptr >= pp | 0 |
3901 | { | - |
3902 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM35); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
3903 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
3904 | eptr--; never executed (the execution status of this line is deduced): eptr--; | - |
3905 | } | 0 |
3906 | } | 0 |
3907 | | - |
3908 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
3909 | } | - |
3910 | } | - |
3911 | /* Control never gets here */ | - |
3912 | | - |
3913 | /* Match a single character type repeatedly; several different opcodes | - |
3914 | share code. This is very similar to the code for single characters, but we | - |
3915 | repeat it in the interests of efficiency. */ | - |
3916 | | - |
3917 | case OP_TYPEEXACT: code before this statement never executed: case OP_TYPEEXACT: | 0 |
3918 | min = max = GET2(ecode, 1); executed (the execution status of this line is deduced): min = max = ecode[1]; | - |
3919 | minimize = TRUE; executed (the execution status of this line is deduced): minimize = 1; | - |
3920 | ecode += 1 + IMM2_SIZE; executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
3921 | goto REPEATTYPE; executed: goto REPEATTYPE; Execution Count:8 | 8 |
3922 | | - |
3923 | case OP_TYPEUPTO: | - |
3924 | case OP_TYPEMINUPTO: | - |
3925 | min = 0; executed (the execution status of this line is deduced): min = 0; | - |
3926 | max = GET2(ecode, 1); executed (the execution status of this line is deduced): max = ecode[1]; | - |
3927 | minimize = *ecode == OP_TYPEMINUPTO; executed (the execution status of this line is deduced): minimize = *ecode == OP_TYPEMINUPTO; | - |
3928 | ecode += 1 + IMM2_SIZE; executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
3929 | goto REPEATTYPE; executed: goto REPEATTYPE; Execution Count:4 | 4 |
3930 | | - |
3931 | case OP_TYPEPOSSTAR: | - |
3932 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3933 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3934 | max = INT_MAX; never executed (the execution status of this line is deduced): max = 2147483647; | - |
3935 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3936 | goto REPEATTYPE; never executed: goto REPEATTYPE; | 0 |
3937 | | - |
3938 | case OP_TYPEPOSPLUS: | - |
3939 | possessive = TRUE; executed (the execution status of this line is deduced): possessive = 1; | - |
3940 | min = 1; executed (the execution status of this line is deduced): min = 1; | - |
3941 | max = INT_MAX; executed (the execution status of this line is deduced): max = 2147483647; | - |
3942 | ecode++; executed (the execution status of this line is deduced): ecode++; | - |
3943 | goto REPEATTYPE; executed: goto REPEATTYPE; Execution Count:3 | 3 |
3944 | | - |
3945 | case OP_TYPEPOSQUERY: | - |
3946 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3947 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3948 | max = 1; never executed (the execution status of this line is deduced): max = 1; | - |
3949 | ecode++; never executed (the execution status of this line is deduced): ecode++; | - |
3950 | goto REPEATTYPE; never executed: goto REPEATTYPE; | 0 |
3951 | | - |
3952 | case OP_TYPEPOSUPTO: | - |
3953 | possessive = TRUE; never executed (the execution status of this line is deduced): possessive = 1; | - |
3954 | min = 0; never executed (the execution status of this line is deduced): min = 0; | - |
3955 | max = GET2(ecode, 1); never executed (the execution status of this line is deduced): max = ecode[1]; | - |
3956 | ecode += 1 + IMM2_SIZE; never executed (the execution status of this line is deduced): ecode += 1 + 1; | - |
3957 | goto REPEATTYPE; never executed: goto REPEATTYPE; | 0 |
3958 | | - |
3959 | case OP_TYPESTAR: | - |
3960 | case OP_TYPEMINSTAR: | - |
3961 | case OP_TYPEPLUS: | - |
3962 | case OP_TYPEMINPLUS: | - |
3963 | case OP_TYPEQUERY: | - |
3964 | case OP_TYPEMINQUERY: | - |
3965 | c = *ecode++ - OP_TYPESTAR; executed (the execution status of this line is deduced): c = *ecode++ - OP_TYPESTAR; | - |
3966 | minimize = (c & 1) != 0; executed (the execution status of this line is deduced): minimize = (c & 1) != 0; | - |
3967 | min = rep_min[c]; /* Pick up values from tables; */ executed (the execution status of this line is deduced): min = rep_min[c]; | - |
3968 | max = rep_max[c]; /* zero for max => infinity */ executed (the execution status of this line is deduced): max = rep_max[c]; | - |
3969 | if (max == 0) max = INT_MAX; executed: max = 2147483647; Execution Count:358 partially evaluated: max == 0 yes Evaluation Count:358 | no Evaluation Count:0 |
| 0-358 |
3970 | | - |
3971 | /* Common code for all repeated single character type matches. Note that | - |
3972 | in UTF-8 mode, '.' matches a character of any length, but for the other | - |
3973 | character types, the valid characters are all one-byte long. */ | - |
3974 | | - |
3975 | REPEATTYPE: code before this statement executed: REPEATTYPE: Execution Count:358 | 358 |
3976 | ctype = *ecode++; /* Code for the character type */ executed (the execution status of this line is deduced): ctype = *ecode++; | - |
3977 | | - |
3978 | #ifdef SUPPORT_UCP | - |
3979 | if (ctype == OP_PROP || ctype == OP_NOTPROP) evaluated: ctype == OP_PROP yes Evaluation Count:2 | yes Evaluation Count:371 |
partially evaluated: ctype == OP_NOTPROP no Evaluation Count:0 | yes Evaluation Count:371 |
| 0-371 |
3980 | { | - |
3981 | prop_fail_result = ctype == OP_NOTPROP; executed (the execution status of this line is deduced): prop_fail_result = ctype == OP_NOTPROP; | - |
3982 | prop_type = *ecode++; executed (the execution status of this line is deduced): prop_type = *ecode++; | - |
3983 | prop_value = *ecode++; executed (the execution status of this line is deduced): prop_value = *ecode++; | - |
3984 | } executed: } Execution Count:2 | 2 |
3985 | else prop_type = -1; executed: prop_type = -1; Execution Count:371 | 371 |
3986 | #endif | - |
3987 | | - |
3988 | /* First, ensure the minimum number of matches are present. Use inline | - |
3989 | code for maximizing the speed, and do the type test once at the start | - |
3990 | (i.e. keep it out of the loop). Separate the UTF-8 code completely as that | - |
3991 | is tidier. Also separate the UCP code, which can be the same for both UTF-8 | - |
3992 | and single-bytes. */ | - |
3993 | | - |
3994 | if (min > 0) evaluated: min > 0 yes Evaluation Count:238 | yes Evaluation Count:135 |
| 135-238 |
3995 | { | - |
3996 | #ifdef SUPPORT_UCP | - |
3997 | if (prop_type >= 0) evaluated: prop_type >= 0 yes Evaluation Count:2 | yes Evaluation Count:236 |
| 2-236 |
3998 | { | - |
3999 | switch(prop_type) | - |
4000 | { | - |
4001 | case PT_ANY: | - |
4002 | if (prop_fail_result) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: prop_fail_result | 0 |
4003 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4004 | { | - |
4005 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4006 | { | - |
4007 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4008 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4009 | } | - |
4010 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4011 | } | 0 |
4012 | break; | 0 |
4013 | | - |
4014 | case PT_LAMP: | - |
4015 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4016 | { | - |
4017 | int chartype; never executed (the execution status of this line is deduced): int chartype; | - |
4018 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4019 | { | - |
4020 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4021 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4022 | } | - |
4023 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4024 | chartype = UCD_CHARTYPE(c); never executed (the execution status of this line is deduced): chartype = (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype; | - |
4025 | if ((chartype == ucp_Lu || never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Lu | 0 |
4026 | chartype == ucp_Ll || never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Ll | 0 |
4027 | chartype == ucp_Lt) == prop_fail_result) never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Lt | 0 |
4028 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4029 | } | 0 |
4030 | break; | 0 |
4031 | | - |
4032 | case PT_GC: | - |
4033 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4034 | { | - |
4035 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4036 | { | - |
4037 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4038 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4039 | } | - |
4040 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4041 | if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == prop_value) == prop_fail_result | 0 |
4042 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4043 | } | 0 |
4044 | break; | 0 |
4045 | | - |
4046 | case PT_PC: | - |
4047 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
4048 | { | - |
4049 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4050 | { | - |
4051 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4052 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4053 | } | - |
4054 | GETCHARINCTEST(c, eptr); never executed: } partially evaluated: utf yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4055 | if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result) partially evaluated: ((_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype == prop_value) == prop_fail_result no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4056 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4057 | } executed: } Execution Count:1 | 1 |
4058 | break; executed: break; Execution Count:1 | 1 |
4059 | | - |
4060 | case PT_SC: | - |
4061 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4062 | { | - |
4063 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4064 | { | - |
4065 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4066 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4067 | } | - |
4068 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4069 | if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result) never evaluated: ((_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->script == prop_value) == prop_fail_result | 0 |
4070 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4071 | } | 0 |
4072 | break; | 0 |
4073 | | - |
4074 | case PT_ALNUM: | - |
4075 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4076 | { | - |
4077 | int category; never executed (the execution status of this line is deduced): int category; | - |
4078 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4079 | { | - |
4080 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4081 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4082 | } | - |
4083 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4084 | category = UCD_CATEGORY(c); never executed (the execution status of this line is deduced): category = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
4085 | if ((category == ucp_L || category == ucp_N) == prop_fail_result) never evaluated: (category == ucp_L || category == ucp_N) == prop_fail_result never evaluated: category == ucp_L never evaluated: category == ucp_N | 0 |
4086 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4087 | } | 0 |
4088 | break; | 0 |
4089 | | - |
4090 | case PT_SPACE: /* Perl space */ | - |
4091 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4092 | { | - |
4093 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4094 | { | - |
4095 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4096 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4097 | } | - |
4098 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4099 | if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z never evaluated: c == '\011' never evaluated: c == '\012' | 0 |
4100 | c == CHAR_FF || c == CHAR_CR) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
4101 | == prop_fail_result) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result | 0 |
4102 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4103 | } | 0 |
4104 | break; | 0 |
4105 | | - |
4106 | case PT_PXSPACE: /* POSIX space */ | - |
4107 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4108 | { | - |
4109 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4110 | { | - |
4111 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4112 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4113 | } | - |
4114 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4115 | if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z never evaluated: c == '\011' never evaluated: c == '\012' | 0 |
4116 | c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result never evaluated: c == '\013' never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
4117 | == prop_fail_result) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result | 0 |
4118 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4119 | } | 0 |
4120 | break; | 0 |
4121 | | - |
4122 | case PT_WORD: | - |
4123 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
4124 | { | - |
4125 | int category; executed (the execution status of this line is deduced): int category; | - |
4126 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4127 | { | - |
4128 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4129 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4130 | } | - |
4131 | GETCHARINCTEST(c, eptr); never executed: } partially evaluated: utf yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4132 | category = UCD_CATEGORY(c); executed (the execution status of this line is deduced): category = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
4133 | if ((category == ucp_L || category == ucp_N || c == CHAR_UNDERSCORE) partially evaluated: (category == ucp_L || category == ucp_N || c == '\137') == prop_fail_result no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: category == ucp_L yes Evaluation Count:1 | no Evaluation Count:0 |
never evaluated: category == ucp_N never evaluated: c == '\137' | 0-1 |
4134 | == prop_fail_result) partially evaluated: (category == ucp_L || category == ucp_N || c == '\137') == prop_fail_result no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
4135 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4136 | } executed: } Execution Count:1 | 1 |
4137 | break; executed: break; Execution Count:1 | 1 |
4138 | | - |
4139 | /* This should not occur */ | - |
4140 | | - |
4141 | default: | - |
4142 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
4143 | } | - |
4144 | } executed: } Execution Count:2 | 2 |
4145 | | - |
4146 | /* Match extended Unicode sequences. We will get here only if the | - |
4147 | support is in the binary; otherwise a compile-time error occurs. */ | - |
4148 | | - |
4149 | else if (ctype == OP_EXTUNI) partially evaluated: ctype == OP_EXTUNI no Evaluation Count:0 | yes Evaluation Count:236 |
| 0-236 |
4150 | { | - |
4151 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4152 | { | - |
4153 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4154 | { | - |
4155 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4156 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4157 | } | - |
4158 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4159 | if (UCD_CATEGORY(c) == ucp_M) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_M | 0 |
4160 | while (eptr < md->end_subject) never evaluated: eptr < md->end_subject | 0 |
4161 | { | - |
4162 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
4163 | if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } never executed: c = *eptr; never executed: } never executed: } never evaluated: (c & 0xfc00) == 0xd800 never evaluated: !utf | 0 |
4164 | if (UCD_CATEGORY(c) != ucp_M) break; never executed: break; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M | 0 |
4165 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
4166 | } | 0 |
4167 | } | 0 |
4168 | } | 0 |
4169 | | - |
4170 | else | - |
4171 | #endif /* SUPPORT_UCP */ | - |
4172 | | - |
4173 | /* Handle all other cases when the coding is UTF-8 */ | - |
4174 | | - |
4175 | #ifdef SUPPORT_UTF | - |
4176 | if (utf) switch(ctype) partially evaluated: utf yes Evaluation Count:236 | no Evaluation Count:0 |
| 0-236 |
4177 | { | - |
4178 | case OP_ANY: | - |
4179 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:2 | yes Evaluation Count:2 |
| 2 |
4180 | { | - |
4181 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4182 | { | - |
4183 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4184 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4185 | } | - |
4186 | if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: (md->nltype != 0) no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4187 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
4188 | ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); never executed: eptr++; partially evaluated: (eptr < md->end_subject) yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: ((*eptr) & 0xfc00) == 0xdc00 no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4189 | } executed: } Execution Count:2 | 2 |
4190 | break; executed: break; Execution Count:2 | 2 |
4191 | | - |
4192 | case OP_ALLANY: | - |
4193 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4194 | { | - |
4195 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4196 | { | - |
4197 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4198 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4199 | } | - |
4200 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4201 | ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); never executed: eptr++; never evaluated: (eptr < md->end_subject) never evaluated: ((*eptr) & 0xfc00) == 0xdc00 | 0 |
4202 | } | 0 |
4203 | break; | 0 |
4204 | | - |
4205 | case OP_ANYBYTE: | - |
4206 | if (eptr > md->end_subject - min) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: eptr > md->end_subject - min | 0 |
4207 | eptr += min; never executed (the execution status of this line is deduced): eptr += min; | - |
4208 | break; | 0 |
4209 | | - |
4210 | case OP_ANYNL: | - |
4211 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4212 | { | - |
4213 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4214 | { | - |
4215 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4216 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4217 | } | - |
4218 | GETCHARINC(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4219 | switch(c) | - |
4220 | { | - |
4221 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4222 | | - |
4223 | case 0x000d: | - |
4224 | if (eptr < md->end_subject && *eptr == 0x0a) eptr++; never executed: eptr++; never evaluated: eptr < md->end_subject never evaluated: *eptr == 0x0a | 0 |
4225 | break; | 0 |
4226 | | - |
4227 | case 0x000a: | - |
4228 | break; | 0 |
4229 | | - |
4230 | case 0x000b: | - |
4231 | case 0x000c: | - |
4232 | case 0x0085: | - |
4233 | case 0x2028: | - |
4234 | case 0x2029: | - |
4235 | if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: md->bsr_anycrlf | 0 |
4236 | break; | 0 |
4237 | } | - |
4238 | } | 0 |
4239 | break; | 0 |
4240 | | - |
4241 | case OP_NOT_HSPACE: | - |
4242 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4243 | { | - |
4244 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4245 | { | - |
4246 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4247 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4248 | } | - |
4249 | GETCHARINC(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4250 | switch(c) | - |
4251 | { | - |
4252 | default: break; | 0 |
4253 | case 0x09: /* HT */ | - |
4254 | case 0x20: /* SPACE */ | - |
4255 | case 0xa0: /* NBSP */ | - |
4256 | case 0x1680: /* OGHAM SPACE MARK */ | - |
4257 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
4258 | case 0x2000: /* EN QUAD */ | - |
4259 | case 0x2001: /* EM QUAD */ | - |
4260 | case 0x2002: /* EN SPACE */ | - |
4261 | case 0x2003: /* EM SPACE */ | - |
4262 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
4263 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
4264 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
4265 | case 0x2007: /* FIGURE SPACE */ | - |
4266 | case 0x2008: /* PUNCTUATION SPACE */ | - |
4267 | case 0x2009: /* THIN SPACE */ | - |
4268 | case 0x200A: /* HAIR SPACE */ | - |
4269 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
4270 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
4271 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
4272 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4273 | } | - |
4274 | } | 0 |
4275 | break; | 0 |
4276 | | - |
4277 | case OP_HSPACE: | - |
4278 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4279 | { | - |
4280 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4281 | { | - |
4282 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4283 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4284 | } | - |
4285 | GETCHARINC(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4286 | switch(c) | - |
4287 | { | - |
4288 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4289 | case 0x09: /* HT */ | - |
4290 | case 0x20: /* SPACE */ | - |
4291 | case 0xa0: /* NBSP */ | - |
4292 | case 0x1680: /* OGHAM SPACE MARK */ | - |
4293 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
4294 | case 0x2000: /* EN QUAD */ | - |
4295 | case 0x2001: /* EM QUAD */ | - |
4296 | case 0x2002: /* EN SPACE */ | - |
4297 | case 0x2003: /* EM SPACE */ | - |
4298 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
4299 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
4300 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
4301 | case 0x2007: /* FIGURE SPACE */ | - |
4302 | case 0x2008: /* PUNCTUATION SPACE */ | - |
4303 | case 0x2009: /* THIN SPACE */ | - |
4304 | case 0x200A: /* HAIR SPACE */ | - |
4305 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
4306 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
4307 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
4308 | break; | 0 |
4309 | } | - |
4310 | } | 0 |
4311 | break; | 0 |
4312 | | - |
4313 | case OP_NOT_VSPACE: | - |
4314 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4315 | { | - |
4316 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4317 | { | - |
4318 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4319 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4320 | } | - |
4321 | GETCHARINC(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4322 | switch(c) | - |
4323 | { | - |
4324 | default: break; | 0 |
4325 | case 0x0a: /* LF */ | - |
4326 | case 0x0b: /* VT */ | - |
4327 | case 0x0c: /* FF */ | - |
4328 | case 0x0d: /* CR */ | - |
4329 | case 0x85: /* NEL */ | - |
4330 | case 0x2028: /* LINE SEPARATOR */ | - |
4331 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
4332 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4333 | } | - |
4334 | } | 0 |
4335 | break; | 0 |
4336 | | - |
4337 | case OP_VSPACE: | - |
4338 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4339 | { | - |
4340 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4341 | { | - |
4342 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4343 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4344 | } | - |
4345 | GETCHARINC(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4346 | switch(c) | - |
4347 | { | - |
4348 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4349 | case 0x0a: /* LF */ | - |
4350 | case 0x0b: /* VT */ | - |
4351 | case 0x0c: /* FF */ | - |
4352 | case 0x0d: /* CR */ | - |
4353 | case 0x85: /* NEL */ | - |
4354 | case 0x2028: /* LINE SEPARATOR */ | - |
4355 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
4356 | break; | 0 |
4357 | } | - |
4358 | } | 0 |
4359 | break; | 0 |
4360 | | - |
4361 | case OP_NOT_DIGIT: | - |
4362 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4363 | { | - |
4364 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4365 | { | - |
4366 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4367 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4368 | } | - |
4369 | GETCHARINC(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4370 | if (c < 128 && (md->ctypes[c] & ctype_digit) != 0) never evaluated: c < 128 never evaluated: (md->ctypes[c] & 0x04) != 0 | 0 |
4371 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4372 | } | 0 |
4373 | break; | 0 |
4374 | | - |
4375 | case OP_DIGIT: | - |
4376 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:43 | yes Evaluation Count:9 |
| 9-43 |
4377 | { | - |
4378 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:5 | yes Evaluation Count:38 |
| 5-38 |
4379 | { | - |
4380 | SCHECK_PARTIAL(); executed: return (-12); Execution Count:1 executed: } Execution Count:1 evaluated: md->partial > 1 yes Evaluation Count:1 | yes Evaluation Count:1 |
evaluated: md->partial != 0 yes Evaluation Count:2 | yes Evaluation Count:3 |
partially evaluated: eptr > md->start_used_ptr yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-3 |
4381 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:4 | 4 |
4382 | } | - |
4383 | if (*eptr >= 128 || (md->ctypes[*eptr] & ctype_digit) == 0) partially evaluated: *eptr >= 128 no Evaluation Count:0 | yes Evaluation Count:38 |
evaluated: (md->ctypes[*eptr] & 0x04) == 0 yes Evaluation Count:19 | yes Evaluation Count:19 |
| 0-38 |
4384 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:19 | 19 |
4385 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
4386 | /* No need to skip more bytes - we know it's a 1-byte character */ | - |
4387 | } executed: } Execution Count:19 | 19 |
4388 | break; executed: break; Execution Count:9 | 9 |
4389 | | - |
4390 | case OP_NOT_WHITESPACE: | - |
4391 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4392 | { | - |
4393 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4394 | { | - |
4395 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4396 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4397 | } | - |
4398 | if (*eptr < 128 && (md->ctypes[*eptr] & ctype_space) != 0) never evaluated: *eptr < 128 never evaluated: (md->ctypes[*eptr] & 0x01) != 0 | 0 |
4399 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4400 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4401 | ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); never executed: eptr++; never evaluated: (eptr < md->end_subject) never evaluated: ((*eptr) & 0xfc00) == 0xdc00 | 0 |
4402 | } | 0 |
4403 | break; | 0 |
4404 | | - |
4405 | case OP_WHITESPACE: | - |
4406 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:70 | yes Evaluation Count:8 |
| 8-70 |
4407 | { | - |
4408 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:2 | yes Evaluation Count:68 |
| 2-68 |
4409 | { | - |
4410 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: eptr > md->start_used_ptr | 0-2 |
4411 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:2 | 2 |
4412 | } | - |
4413 | if (*eptr >= 128 || (md->ctypes[*eptr] & ctype_space) == 0) partially evaluated: *eptr >= 128 no Evaluation Count:0 | yes Evaluation Count:68 |
evaluated: (md->ctypes[*eptr] & 0x01) == 0 yes Evaluation Count:60 | yes Evaluation Count:8 |
| 0-68 |
4414 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:60 | 60 |
4415 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
4416 | /* No need to skip more bytes - we know it's a 1-byte character */ | - |
4417 | } executed: } Execution Count:8 | 8 |
4418 | break; executed: break; Execution Count:8 | 8 |
4419 | | - |
4420 | case OP_NOT_WORDCHAR: | - |
4421 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:74 | yes Evaluation Count:12 |
| 12-74 |
4422 | { | - |
4423 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:2 | yes Evaluation Count:72 |
| 2-72 |
4424 | { | - |
4425 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: eptr > md->start_used_ptr | 0-2 |
4426 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:2 | 2 |
4427 | } | - |
4428 | if (*eptr < 128 && (md->ctypes[*eptr] & ctype_word) != 0) partially evaluated: *eptr < 128 yes Evaluation Count:72 | no Evaluation Count:0 |
evaluated: (md->ctypes[*eptr] & 0x10) != 0 yes Evaluation Count:60 | yes Evaluation Count:12 |
| 0-72 |
4429 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:60 | 60 |
4430 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
4431 | ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); never executed: eptr++; evaluated: (eptr < md->end_subject) yes Evaluation Count:10 | yes Evaluation Count:2 |
partially evaluated: ((*eptr) & 0xfc00) == 0xdc00 no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
4432 | } executed: } Execution Count:12 | 12 |
4433 | break; executed: break; Execution Count:12 | 12 |
4434 | | - |
4435 | case OP_WORDCHAR: | - |
4436 | for (i = 1; i <= min; i++) evaluated: i <= min yes Evaluation Count:65 | yes Evaluation Count:42 |
| 42-65 |
4437 | { | - |
4438 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:5 | yes Evaluation Count:60 |
| 5-60 |
4439 | { | - |
4440 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:5 |
never evaluated: eptr > md->start_used_ptr | 0-5 |
4441 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:5 | 5 |
4442 | } | - |
4443 | if (*eptr >= 128 || (md->ctypes[*eptr] & ctype_word) == 0) partially evaluated: *eptr >= 128 no Evaluation Count:0 | yes Evaluation Count:60 |
evaluated: (md->ctypes[*eptr] & 0x10) == 0 yes Evaluation Count:10 | yes Evaluation Count:50 |
| 0-60 |
4444 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:10 | 10 |
4445 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
4446 | /* No need to skip more bytes - we know it's a 1-byte character */ | - |
4447 | } executed: } Execution Count:50 | 50 |
4448 | break; executed: break; Execution Count:42 | 42 |
4449 | | - |
4450 | default: | - |
4451 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
4452 | } /* End switch(ctype) */ | 0 |
4453 | | - |
4454 | else | - |
4455 | #endif /* SUPPORT_UTF */ | - |
4456 | | - |
4457 | /* Code for the non-UTF-8 case for minimum matching of operators other | - |
4458 | than OP_PROP and OP_NOTPROP. */ | - |
4459 | | - |
4460 | switch(ctype) | - |
4461 | { | - |
4462 | case OP_ANY: | - |
4463 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4464 | { | - |
4465 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4466 | { | - |
4467 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4468 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4469 | } | - |
4470 | if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: (md->nltype != 0) | 0 |
4471 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4472 | } | 0 |
4473 | break; | 0 |
4474 | | - |
4475 | case OP_ALLANY: | - |
4476 | if (eptr > md->end_subject - min) never evaluated: eptr > md->end_subject - min | 0 |
4477 | { | - |
4478 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4479 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4480 | } | - |
4481 | eptr += min; never executed (the execution status of this line is deduced): eptr += min; | - |
4482 | break; | 0 |
4483 | | - |
4484 | case OP_ANYBYTE: | - |
4485 | if (eptr > md->end_subject - min) never evaluated: eptr > md->end_subject - min | 0 |
4486 | { | - |
4487 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4488 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4489 | } | - |
4490 | eptr += min; never executed (the execution status of this line is deduced): eptr += min; | - |
4491 | break; | 0 |
4492 | | - |
4493 | case OP_ANYNL: | - |
4494 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4495 | { | - |
4496 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4497 | { | - |
4498 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4499 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4500 | } | - |
4501 | switch(*eptr++) | - |
4502 | { | - |
4503 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4504 | | - |
4505 | case 0x000d: | - |
4506 | if (eptr < md->end_subject && *eptr == 0x0a) eptr++; never executed: eptr++; never evaluated: eptr < md->end_subject never evaluated: *eptr == 0x0a | 0 |
4507 | break; | 0 |
4508 | | - |
4509 | case 0x000a: | - |
4510 | break; | 0 |
4511 | | - |
4512 | case 0x000b: | - |
4513 | case 0x000c: | - |
4514 | case 0x0085: | - |
4515 | #ifdef COMPILE_PCRE16 | - |
4516 | case 0x2028: | - |
4517 | case 0x2029: | - |
4518 | #endif | - |
4519 | if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: md->bsr_anycrlf | 0 |
4520 | break; | 0 |
4521 | } | - |
4522 | } | 0 |
4523 | break; | 0 |
4524 | | - |
4525 | case OP_NOT_HSPACE: | - |
4526 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4527 | { | - |
4528 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4529 | { | - |
4530 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4531 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4532 | } | - |
4533 | switch(*eptr++) | - |
4534 | { | - |
4535 | default: break; | 0 |
4536 | case 0x09: /* HT */ | - |
4537 | case 0x20: /* SPACE */ | - |
4538 | case 0xa0: /* NBSP */ | - |
4539 | #ifdef COMPILE_PCRE16 | - |
4540 | case 0x1680: /* OGHAM SPACE MARK */ | - |
4541 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
4542 | case 0x2000: /* EN QUAD */ | - |
4543 | case 0x2001: /* EM QUAD */ | - |
4544 | case 0x2002: /* EN SPACE */ | - |
4545 | case 0x2003: /* EM SPACE */ | - |
4546 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
4547 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
4548 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
4549 | case 0x2007: /* FIGURE SPACE */ | - |
4550 | case 0x2008: /* PUNCTUATION SPACE */ | - |
4551 | case 0x2009: /* THIN SPACE */ | - |
4552 | case 0x200A: /* HAIR SPACE */ | - |
4553 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
4554 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
4555 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
4556 | #endif | - |
4557 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4558 | } | - |
4559 | } | 0 |
4560 | break; | 0 |
4561 | | - |
4562 | case OP_HSPACE: | - |
4563 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4564 | { | - |
4565 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4566 | { | - |
4567 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4568 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4569 | } | - |
4570 | switch(*eptr++) | - |
4571 | { | - |
4572 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4573 | case 0x09: /* HT */ | - |
4574 | case 0x20: /* SPACE */ | - |
4575 | case 0xa0: /* NBSP */ | - |
4576 | #ifdef COMPILE_PCRE16 | - |
4577 | case 0x1680: /* OGHAM SPACE MARK */ | - |
4578 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
4579 | case 0x2000: /* EN QUAD */ | - |
4580 | case 0x2001: /* EM QUAD */ | - |
4581 | case 0x2002: /* EN SPACE */ | - |
4582 | case 0x2003: /* EM SPACE */ | - |
4583 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
4584 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
4585 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
4586 | case 0x2007: /* FIGURE SPACE */ | - |
4587 | case 0x2008: /* PUNCTUATION SPACE */ | - |
4588 | case 0x2009: /* THIN SPACE */ | - |
4589 | case 0x200A: /* HAIR SPACE */ | - |
4590 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
4591 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
4592 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
4593 | #endif | - |
4594 | break; | 0 |
4595 | } | - |
4596 | } | 0 |
4597 | break; | 0 |
4598 | | - |
4599 | case OP_NOT_VSPACE: | - |
4600 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4601 | { | - |
4602 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4603 | { | - |
4604 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4605 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4606 | } | - |
4607 | switch(*eptr++) | - |
4608 | { | - |
4609 | default: break; | 0 |
4610 | case 0x0a: /* LF */ | - |
4611 | case 0x0b: /* VT */ | - |
4612 | case 0x0c: /* FF */ | - |
4613 | case 0x0d: /* CR */ | - |
4614 | case 0x85: /* NEL */ | - |
4615 | #ifdef COMPILE_PCRE16 | - |
4616 | case 0x2028: /* LINE SEPARATOR */ | - |
4617 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
4618 | #endif | - |
4619 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4620 | } | - |
4621 | } | 0 |
4622 | break; | 0 |
4623 | | - |
4624 | case OP_VSPACE: | - |
4625 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4626 | { | - |
4627 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4628 | { | - |
4629 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4630 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4631 | } | - |
4632 | switch(*eptr++) | - |
4633 | { | - |
4634 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4635 | case 0x0a: /* LF */ | - |
4636 | case 0x0b: /* VT */ | - |
4637 | case 0x0c: /* FF */ | - |
4638 | case 0x0d: /* CR */ | - |
4639 | case 0x85: /* NEL */ | - |
4640 | #ifdef COMPILE_PCRE16 | - |
4641 | case 0x2028: /* LINE SEPARATOR */ | - |
4642 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
4643 | #endif | - |
4644 | break; | 0 |
4645 | } | - |
4646 | } | 0 |
4647 | break; | 0 |
4648 | | - |
4649 | case OP_NOT_DIGIT: | - |
4650 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4651 | { | - |
4652 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4653 | { | - |
4654 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4655 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4656 | } | - |
4657 | if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_digit) != 0) never evaluated: ((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x04) != 0 | 0 |
4658 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4659 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4660 | } | 0 |
4661 | break; | 0 |
4662 | | - |
4663 | case OP_DIGIT: | - |
4664 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4665 | { | - |
4666 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4667 | { | - |
4668 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4669 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4670 | } | - |
4671 | if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_digit) == 0) never evaluated: !((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x04) == 0 | 0 |
4672 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4673 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4674 | } | 0 |
4675 | break; | 0 |
4676 | | - |
4677 | case OP_NOT_WHITESPACE: | - |
4678 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4679 | { | - |
4680 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4681 | { | - |
4682 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4683 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4684 | } | - |
4685 | if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_space) != 0) never evaluated: ((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x01) != 0 | 0 |
4686 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4687 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4688 | } | 0 |
4689 | break; | 0 |
4690 | | - |
4691 | case OP_WHITESPACE: | - |
4692 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4693 | { | - |
4694 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4695 | { | - |
4696 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4697 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4698 | } | - |
4699 | if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_space) == 0) never evaluated: !((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x01) == 0 | 0 |
4700 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4701 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4702 | } | 0 |
4703 | break; | 0 |
4704 | | - |
4705 | case OP_NOT_WORDCHAR: | - |
4706 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4707 | { | - |
4708 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4709 | { | - |
4710 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4711 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4712 | } | - |
4713 | if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_word) != 0) never evaluated: ((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x10) != 0 | 0 |
4714 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4715 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4716 | } | 0 |
4717 | break; | 0 |
4718 | | - |
4719 | case OP_WORDCHAR: | - |
4720 | for (i = 1; i <= min; i++) never evaluated: i <= min | 0 |
4721 | { | - |
4722 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4723 | { | - |
4724 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4725 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4726 | } | - |
4727 | if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_word) == 0) never evaluated: !((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x10) == 0 | 0 |
4728 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4729 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
4730 | } | 0 |
4731 | break; | 0 |
4732 | | - |
4733 | default: | - |
4734 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
4735 | } | 0 |
4736 | } | - |
4737 | | - |
4738 | /* If min = max, continue at the same level without recursing */ | - |
4739 | | - |
4740 | if (min == max) continue; executed: continue; Execution Count:6 evaluated: min == max yes Evaluation Count:6 | yes Evaluation Count:204 |
| 6-204 |
4741 | | - |
4742 | /* If minimizing, we have to test the rest of the pattern before each | - |
4743 | subsequent match. Again, separate the UTF-8 case for speed, and also | - |
4744 | separate the UCP cases. */ | - |
4745 | | - |
4746 | if (minimize) evaluated: minimize yes Evaluation Count:7 | yes Evaluation Count:197 |
| 7-197 |
4747 | { | - |
4748 | #ifdef SUPPORT_UCP | - |
4749 | if (prop_type >= 0) partially evaluated: prop_type >= 0 no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
4750 | { | - |
4751 | switch(prop_type) | - |
4752 | { | - |
4753 | case PT_ANY: | - |
4754 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4755 | { | - |
4756 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM36); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4757 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4758 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4759 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4760 | { | - |
4761 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4762 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4763 | } | - |
4764 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4765 | if (prop_fail_result) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: prop_fail_result | 0 |
4766 | } | 0 |
4767 | /* Control never gets here */ | - |
4768 | | - |
4769 | case PT_LAMP: code before this statement never executed: case 1: | 0 |
4770 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4771 | { | - |
4772 | int chartype; never executed (the execution status of this line is deduced): int chartype; | - |
4773 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM37); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4774 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4775 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4776 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4777 | { | - |
4778 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4779 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4780 | } | - |
4781 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4782 | chartype = UCD_CHARTYPE(c); never executed (the execution status of this line is deduced): chartype = (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype; | - |
4783 | if ((chartype == ucp_Lu || never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Lu | 0 |
4784 | chartype == ucp_Ll || never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Ll | 0 |
4785 | chartype == ucp_Lt) == prop_fail_result) never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Lt | 0 |
4786 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4787 | } | 0 |
4788 | /* Control never gets here */ | - |
4789 | | - |
4790 | case PT_GC: code before this statement never executed: case 2: | 0 |
4791 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4792 | { | - |
4793 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM38); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4794 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4795 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4796 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4797 | { | - |
4798 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4799 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4800 | } | - |
4801 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4802 | if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == prop_value) == prop_fail_result | 0 |
4803 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4804 | } | 0 |
4805 | /* Control never gets here */ | - |
4806 | | - |
4807 | case PT_PC: code before this statement never executed: case 3: | 0 |
4808 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4809 | { | - |
4810 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM39); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4811 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4812 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4813 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4814 | { | - |
4815 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4816 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4817 | } | - |
4818 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4819 | if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result) never evaluated: ((_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype == prop_value) == prop_fail_result | 0 |
4820 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4821 | } | 0 |
4822 | /* Control never gets here */ | - |
4823 | | - |
4824 | case PT_SC: code before this statement never executed: case 4: | 0 |
4825 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4826 | { | - |
4827 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM40); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4828 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4829 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4830 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4831 | { | - |
4832 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4833 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4834 | } | - |
4835 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4836 | if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result) never evaluated: ((_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->script == prop_value) == prop_fail_result | 0 |
4837 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4838 | } | 0 |
4839 | /* Control never gets here */ | - |
4840 | | - |
4841 | case PT_ALNUM: code before this statement never executed: case 5: | 0 |
4842 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4843 | { | - |
4844 | int category; never executed (the execution status of this line is deduced): int category; | - |
4845 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM59); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4846 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4847 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4848 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4849 | { | - |
4850 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4851 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4852 | } | - |
4853 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4854 | category = UCD_CATEGORY(c); never executed (the execution status of this line is deduced): category = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
4855 | if ((category == ucp_L || category == ucp_N) == prop_fail_result) never evaluated: (category == ucp_L || category == ucp_N) == prop_fail_result never evaluated: category == ucp_L never evaluated: category == ucp_N | 0 |
4856 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4857 | } | 0 |
4858 | /* Control never gets here */ | - |
4859 | | - |
4860 | case PT_SPACE: /* Perl space */ code before this statement never executed: case 6: | 0 |
4861 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4862 | { | - |
4863 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM60); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4864 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4865 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4866 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4867 | { | - |
4868 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4869 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4870 | } | - |
4871 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4872 | if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z never evaluated: c == '\011' never evaluated: c == '\012' | 0 |
4873 | c == CHAR_FF || c == CHAR_CR) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
4874 | == prop_fail_result) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result | 0 |
4875 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4876 | } | 0 |
4877 | /* Control never gets here */ | - |
4878 | | - |
4879 | case PT_PXSPACE: /* POSIX space */ code before this statement never executed: case 7: | 0 |
4880 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4881 | { | - |
4882 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM61); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4883 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4884 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4885 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4886 | { | - |
4887 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4888 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4889 | } | - |
4890 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4891 | if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z never evaluated: c == '\011' never evaluated: c == '\012' | 0 |
4892 | c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result never evaluated: c == '\013' never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
4893 | == prop_fail_result) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result | 0 |
4894 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4895 | } | 0 |
4896 | /* Control never gets here */ | - |
4897 | | - |
4898 | case PT_WORD: code before this statement never executed: case 8: | 0 |
4899 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4900 | { | - |
4901 | int category; never executed (the execution status of this line is deduced): int category; | - |
4902 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM62); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4903 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4904 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4905 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4906 | { | - |
4907 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4908 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4909 | } | - |
4910 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4911 | category = UCD_CATEGORY(c); never executed (the execution status of this line is deduced): category = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
4912 | if ((category == ucp_L || never evaluated: (category == ucp_L || category == ucp_N || c == '\137') == prop_fail_result never evaluated: category == ucp_L | 0 |
4913 | category == ucp_N || never evaluated: (category == ucp_L || category == ucp_N || c == '\137') == prop_fail_result never evaluated: category == ucp_N | 0 |
4914 | c == CHAR_UNDERSCORE) never evaluated: (category == ucp_L || category == ucp_N || c == '\137') == prop_fail_result never evaluated: c == '\137' | 0 |
4915 | == prop_fail_result) never evaluated: (category == ucp_L || category == ucp_N || c == '\137') == prop_fail_result | 0 |
4916 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4917 | } | 0 |
4918 | /* Control never gets here */ | - |
4919 | | - |
4920 | /* This should never occur */ | - |
4921 | | - |
4922 | default: | - |
4923 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
4924 | } | - |
4925 | } | 0 |
4926 | | - |
4927 | /* Match extended Unicode sequences. We will get here only if the | - |
4928 | support is in the binary; otherwise a compile-time error occurs. */ | - |
4929 | | - |
4930 | else if (ctype == OP_EXTUNI) partially evaluated: ctype == OP_EXTUNI no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
4931 | { | - |
4932 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4933 | { | - |
4934 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM41); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4935 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
4936 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
4937 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
4938 | { | - |
4939 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4940 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4941 | } | - |
4942 | GETCHARINCTEST(c, eptr); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
4943 | if (UCD_CATEGORY(c) == ucp_M) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_M | 0 |
4944 | while (eptr < md->end_subject) never evaluated: eptr < md->end_subject | 0 |
4945 | { | - |
4946 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
4947 | if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } never executed: c = *eptr; never executed: } never executed: } never evaluated: (c & 0xfc00) == 0xd800 never evaluated: !utf | 0 |
4948 | if (UCD_CATEGORY(c) != ucp_M) break; never executed: break; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M | 0 |
4949 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
4950 | } | 0 |
4951 | } | 0 |
4952 | } | 0 |
4953 | else | - |
4954 | #endif /* SUPPORT_UCP */ | - |
4955 | | - |
4956 | #ifdef SUPPORT_UTF | - |
4957 | if (utf) partially evaluated: utf yes Evaluation Count:7 | no Evaluation Count:0 |
| 0-7 |
4958 | { | - |
4959 | for (fi = min;; fi++) executed (the execution status of this line is deduced): for (i = min;; i++) | - |
4960 | { | - |
4961 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM42); executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
4962 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:7 evaluated: rrc != 0 yes Evaluation Count:7 | yes Evaluation Count:2 |
| 2-7 |
4963 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; partially evaluated: i >= max no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4964 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4965 | { | - |
4966 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
4967 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4968 | } | - |
4969 | if (ctype == OP_ANY && IS_NEWLINE(eptr)) partially evaluated: ctype == OP_ANY yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: (md->nltype != 0) no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4970 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4971 | GETCHARINC(c, eptr); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4972 | switch(ctype) | - |
4973 | { | - |
4974 | case OP_ANY: /* This is the non-NL case */ | - |
4975 | case OP_ALLANY: | - |
4976 | case OP_ANYBYTE: | - |
4977 | break; executed: break; Execution Count:2 | 2 |
4978 | | - |
4979 | case OP_ANYNL: | - |
4980 | switch(c) | - |
4981 | { | - |
4982 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
4983 | case 0x000d: | - |
4984 | if (eptr < md->end_subject && *eptr == 0x0a) eptr++; never executed: eptr++; never evaluated: eptr < md->end_subject never evaluated: *eptr == 0x0a | 0 |
4985 | break; | 0 |
4986 | case 0x000a: | - |
4987 | break; | 0 |
4988 | | - |
4989 | case 0x000b: | - |
4990 | case 0x000c: | - |
4991 | case 0x0085: | - |
4992 | case 0x2028: | - |
4993 | case 0x2029: | - |
4994 | if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: md->bsr_anycrlf | 0 |
4995 | break; | 0 |
4996 | } | - |
4997 | break; | 0 |
4998 | | - |
4999 | case OP_NOT_HSPACE: | - |
5000 | switch(c) | - |
5001 | { | - |
5002 | default: break; | 0 |
5003 | case 0x09: /* HT */ | - |
5004 | case 0x20: /* SPACE */ | - |
5005 | case 0xa0: /* NBSP */ | - |
5006 | case 0x1680: /* OGHAM SPACE MARK */ | - |
5007 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
5008 | case 0x2000: /* EN QUAD */ | - |
5009 | case 0x2001: /* EM QUAD */ | - |
5010 | case 0x2002: /* EN SPACE */ | - |
5011 | case 0x2003: /* EM SPACE */ | - |
5012 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
5013 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
5014 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
5015 | case 0x2007: /* FIGURE SPACE */ | - |
5016 | case 0x2008: /* PUNCTUATION SPACE */ | - |
5017 | case 0x2009: /* THIN SPACE */ | - |
5018 | case 0x200A: /* HAIR SPACE */ | - |
5019 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
5020 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
5021 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
5022 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5023 | } | - |
5024 | break; | 0 |
5025 | | - |
5026 | case OP_HSPACE: | - |
5027 | switch(c) | - |
5028 | { | - |
5029 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5030 | case 0x09: /* HT */ | - |
5031 | case 0x20: /* SPACE */ | - |
5032 | case 0xa0: /* NBSP */ | - |
5033 | case 0x1680: /* OGHAM SPACE MARK */ | - |
5034 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
5035 | case 0x2000: /* EN QUAD */ | - |
5036 | case 0x2001: /* EM QUAD */ | - |
5037 | case 0x2002: /* EN SPACE */ | - |
5038 | case 0x2003: /* EM SPACE */ | - |
5039 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
5040 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
5041 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
5042 | case 0x2007: /* FIGURE SPACE */ | - |
5043 | case 0x2008: /* PUNCTUATION SPACE */ | - |
5044 | case 0x2009: /* THIN SPACE */ | - |
5045 | case 0x200A: /* HAIR SPACE */ | - |
5046 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
5047 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
5048 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
5049 | break; | 0 |
5050 | } | - |
5051 | break; | 0 |
5052 | | - |
5053 | case OP_NOT_VSPACE: | - |
5054 | switch(c) | - |
5055 | { | - |
5056 | default: break; | 0 |
5057 | case 0x0a: /* LF */ | - |
5058 | case 0x0b: /* VT */ | - |
5059 | case 0x0c: /* FF */ | - |
5060 | case 0x0d: /* CR */ | - |
5061 | case 0x85: /* NEL */ | - |
5062 | case 0x2028: /* LINE SEPARATOR */ | - |
5063 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
5064 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5065 | } | - |
5066 | break; | 0 |
5067 | | - |
5068 | case OP_VSPACE: | - |
5069 | switch(c) | - |
5070 | { | - |
5071 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5072 | case 0x0a: /* LF */ | - |
5073 | case 0x0b: /* VT */ | - |
5074 | case 0x0c: /* FF */ | - |
5075 | case 0x0d: /* CR */ | - |
5076 | case 0x85: /* NEL */ | - |
5077 | case 0x2028: /* LINE SEPARATOR */ | - |
5078 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
5079 | break; | 0 |
5080 | } | - |
5081 | break; | 0 |
5082 | | - |
5083 | case OP_NOT_DIGIT: | - |
5084 | if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) never evaluated: c < 256 never evaluated: (md->ctypes[c] & 0x04) != 0 | 0 |
5085 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5086 | break; | 0 |
5087 | | - |
5088 | case OP_DIGIT: | - |
5089 | if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0) never evaluated: c >= 256 never evaluated: (md->ctypes[c] & 0x04) == 0 | 0 |
5090 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5091 | break; | 0 |
5092 | | - |
5093 | case OP_NOT_WHITESPACE: | - |
5094 | if (c < 256 && (md->ctypes[c] & ctype_space) != 0) never evaluated: c < 256 never evaluated: (md->ctypes[c] & 0x01) != 0 | 0 |
5095 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5096 | break; | 0 |
5097 | | - |
5098 | case OP_WHITESPACE: | - |
5099 | if (c >= 256 || (md->ctypes[c] & ctype_space) == 0) never evaluated: c >= 256 never evaluated: (md->ctypes[c] & 0x01) == 0 | 0 |
5100 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5101 | break; | 0 |
5102 | | - |
5103 | case OP_NOT_WORDCHAR: | - |
5104 | if (c < 256 && (md->ctypes[c] & ctype_word) != 0) never evaluated: c < 256 never evaluated: (md->ctypes[c] & 0x10) != 0 | 0 |
5105 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5106 | break; | 0 |
5107 | | - |
5108 | case OP_WORDCHAR: | - |
5109 | if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) never evaluated: c >= 256 never evaluated: (md->ctypes[c] & 0x10) == 0 | 0 |
5110 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5111 | break; | 0 |
5112 | | - |
5113 | default: | - |
5114 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
5115 | } | - |
5116 | } executed: } Execution Count:2 | 2 |
5117 | } | 0 |
5118 | else | - |
5119 | #endif | - |
5120 | /* Not UTF mode */ | - |
5121 | { | - |
5122 | for (fi = min;; fi++) never executed (the execution status of this line is deduced): for (i = min;; i++) | - |
5123 | { | - |
5124 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM43); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
5125 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
5126 | if (fi >= max) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: i >= max | 0 |
5127 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5128 | { | - |
5129 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5130 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5131 | } | - |
5132 | if (ctype == OP_ANY && IS_NEWLINE(eptr)) never evaluated: ctype == OP_ANY never evaluated: (md->nltype != 0) | 0 |
5133 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5134 | c = *eptr++; never executed (the execution status of this line is deduced): c = *eptr++; | - |
5135 | switch(ctype) | - |
5136 | { | - |
5137 | case OP_ANY: /* This is the non-NL case */ | - |
5138 | case OP_ALLANY: | - |
5139 | case OP_ANYBYTE: | - |
5140 | break; | 0 |
5141 | | - |
5142 | case OP_ANYNL: | - |
5143 | switch(c) | - |
5144 | { | - |
5145 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5146 | case 0x000d: | - |
5147 | if (eptr < md->end_subject && *eptr == 0x0a) eptr++; never executed: eptr++; never evaluated: eptr < md->end_subject never evaluated: *eptr == 0x0a | 0 |
5148 | break; | 0 |
5149 | | - |
5150 | case 0x000a: | - |
5151 | break; | 0 |
5152 | | - |
5153 | case 0x000b: | - |
5154 | case 0x000c: | - |
5155 | case 0x0085: | - |
5156 | #ifdef COMPILE_PCRE16 | - |
5157 | case 0x2028: | - |
5158 | case 0x2029: | - |
5159 | #endif | - |
5160 | if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: md->bsr_anycrlf | 0 |
5161 | break; | 0 |
5162 | } | - |
5163 | break; | 0 |
5164 | | - |
5165 | case OP_NOT_HSPACE: | - |
5166 | switch(c) | - |
5167 | { | - |
5168 | default: break; | 0 |
5169 | case 0x09: /* HT */ | - |
5170 | case 0x20: /* SPACE */ | - |
5171 | case 0xa0: /* NBSP */ | - |
5172 | #ifdef COMPILE_PCRE16 | - |
5173 | case 0x1680: /* OGHAM SPACE MARK */ | - |
5174 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
5175 | case 0x2000: /* EN QUAD */ | - |
5176 | case 0x2001: /* EM QUAD */ | - |
5177 | case 0x2002: /* EN SPACE */ | - |
5178 | case 0x2003: /* EM SPACE */ | - |
5179 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
5180 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
5181 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
5182 | case 0x2007: /* FIGURE SPACE */ | - |
5183 | case 0x2008: /* PUNCTUATION SPACE */ | - |
5184 | case 0x2009: /* THIN SPACE */ | - |
5185 | case 0x200A: /* HAIR SPACE */ | - |
5186 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
5187 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
5188 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
5189 | #endif | - |
5190 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5191 | } | - |
5192 | break; | 0 |
5193 | | - |
5194 | case OP_HSPACE: | - |
5195 | switch(c) | - |
5196 | { | - |
5197 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5198 | case 0x09: /* HT */ | - |
5199 | case 0x20: /* SPACE */ | - |
5200 | case 0xa0: /* NBSP */ | - |
5201 | #ifdef COMPILE_PCRE16 | - |
5202 | case 0x1680: /* OGHAM SPACE MARK */ | - |
5203 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
5204 | case 0x2000: /* EN QUAD */ | - |
5205 | case 0x2001: /* EM QUAD */ | - |
5206 | case 0x2002: /* EN SPACE */ | - |
5207 | case 0x2003: /* EM SPACE */ | - |
5208 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
5209 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
5210 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
5211 | case 0x2007: /* FIGURE SPACE */ | - |
5212 | case 0x2008: /* PUNCTUATION SPACE */ | - |
5213 | case 0x2009: /* THIN SPACE */ | - |
5214 | case 0x200A: /* HAIR SPACE */ | - |
5215 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
5216 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
5217 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
5218 | #endif | - |
5219 | break; | 0 |
5220 | } | - |
5221 | break; | 0 |
5222 | | - |
5223 | case OP_NOT_VSPACE: | - |
5224 | switch(c) | - |
5225 | { | - |
5226 | default: break; | 0 |
5227 | case 0x0a: /* LF */ | - |
5228 | case 0x0b: /* VT */ | - |
5229 | case 0x0c: /* FF */ | - |
5230 | case 0x0d: /* CR */ | - |
5231 | case 0x85: /* NEL */ | - |
5232 | #ifdef COMPILE_PCRE16 | - |
5233 | case 0x2028: /* LINE SEPARATOR */ | - |
5234 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
5235 | #endif | - |
5236 | RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5237 | } | - |
5238 | break; | 0 |
5239 | | - |
5240 | case OP_VSPACE: | - |
5241 | switch(c) | - |
5242 | { | - |
5243 | default: RRETURN(MATCH_NOMATCH); never executed: return 0; | 0 |
5244 | case 0x0a: /* LF */ | - |
5245 | case 0x0b: /* VT */ | - |
5246 | case 0x0c: /* FF */ | - |
5247 | case 0x0d: /* CR */ | - |
5248 | case 0x85: /* NEL */ | - |
5249 | #ifdef COMPILE_PCRE16 | - |
5250 | case 0x2028: /* LINE SEPARATOR */ | - |
5251 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
5252 | #endif | - |
5253 | break; | 0 |
5254 | } | - |
5255 | break; | 0 |
5256 | | - |
5257 | case OP_NOT_DIGIT: | - |
5258 | if (MAX_255(c) && (md->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: ((c) <= 255u) never evaluated: (md->ctypes[c] & 0x04) != 0 | 0 |
5259 | break; | 0 |
5260 | | - |
5261 | case OP_DIGIT: | - |
5262 | if (!MAX_255(c) || (md->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: !((c) <= 255u) never evaluated: (md->ctypes[c] & 0x04) == 0 | 0 |
5263 | break; | 0 |
5264 | | - |
5265 | case OP_NOT_WHITESPACE: | - |
5266 | if (MAX_255(c) && (md->ctypes[c] & ctype_space) != 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: ((c) <= 255u) never evaluated: (md->ctypes[c] & 0x01) != 0 | 0 |
5267 | break; | 0 |
5268 | | - |
5269 | case OP_WHITESPACE: | - |
5270 | if (!MAX_255(c) || (md->ctypes[c] & ctype_space) == 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: !((c) <= 255u) never evaluated: (md->ctypes[c] & 0x01) == 0 | 0 |
5271 | break; | 0 |
5272 | | - |
5273 | case OP_NOT_WORDCHAR: | - |
5274 | if (MAX_255(c) && (md->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: ((c) <= 255u) never evaluated: (md->ctypes[c] & 0x10) != 0 | 0 |
5275 | break; | 0 |
5276 | | - |
5277 | case OP_WORDCHAR: | - |
5278 | if (!MAX_255(c) || (md->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH); never executed: return 0; never evaluated: !((c) <= 255u) never evaluated: (md->ctypes[c] & 0x10) == 0 | 0 |
5279 | break; | 0 |
5280 | | - |
5281 | default: | - |
5282 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
5283 | } | - |
5284 | } | 0 |
5285 | } | 0 |
5286 | /* Control never gets here */ | - |
5287 | } | - |
5288 | | - |
5289 | /* If maximizing, it is worth using inline code for speed, doing the type | - |
5290 | test once at the start (i.e. keep it out of the loop). Again, keep the | - |
5291 | UTF-8 and UCP stuff separate. */ | - |
5292 | | - |
5293 | else | - |
5294 | { | - |
5295 | pp = eptr; /* Remember where we started */ executed (the execution status of this line is deduced): pp = eptr; | - |
5296 | | - |
5297 | #ifdef SUPPORT_UCP | - |
5298 | if (prop_type >= 0) evaluated: prop_type >= 0 yes Evaluation Count:2 | yes Evaluation Count:195 |
| 2-195 |
5299 | { | - |
5300 | switch(prop_type) | - |
5301 | { | - |
5302 | case PT_ANY: | - |
5303 | for (i = min; i < max; i++) | 0 |
5304 | { | - |
5305 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5306 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5307 | { | - |
5308 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5309 | break; | 0 |
5310 | } | - |
5311 | GETCHARLENTEST(c, eptr, len); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5312 | if (prop_fail_result) break; never executed: break; never evaluated: prop_fail_result | 0 |
5313 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5314 | } | 0 |
5315 | break; | 0 |
5316 | | - |
5317 | case PT_LAMP: | - |
5318 | for (i = min; i < max; i++) | 0 |
5319 | { | - |
5320 | int chartype; never executed (the execution status of this line is deduced): int chartype; | - |
5321 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5322 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5323 | { | - |
5324 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5325 | break; | 0 |
5326 | } | - |
5327 | GETCHARLENTEST(c, eptr, len); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5328 | chartype = UCD_CHARTYPE(c); never executed (the execution status of this line is deduced): chartype = (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype; | - |
5329 | if ((chartype == ucp_Lu || never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Lu | 0 |
5330 | chartype == ucp_Ll || never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Ll | 0 |
5331 | chartype == ucp_Lt) == prop_fail_result) never evaluated: (chartype == ucp_Lu || chartype == ucp_Ll || chartype == ucp_Lt) == prop_fail_result never evaluated: chartype == ucp_Lt | 0 |
5332 | break; | 0 |
5333 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5334 | } | 0 |
5335 | break; | 0 |
5336 | | - |
5337 | case PT_GC: | - |
5338 | for (i = min; i < max; i++) | 0 |
5339 | { | - |
5340 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5341 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5342 | { | - |
5343 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5344 | break; | 0 |
5345 | } | - |
5346 | GETCHARLENTEST(c, eptr, len); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5347 | if ((UCD_CATEGORY(c) == prop_value) == prop_fail_result) break; never executed: break; never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == prop_value) == prop_fail_result | 0 |
5348 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5349 | } | 0 |
5350 | break; | 0 |
5351 | | - |
5352 | case PT_PC: | - |
5353 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
5354 | { | - |
5355 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
5356 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:1 | yes Evaluation Count:4 |
| 1-4 |
5357 | { | - |
5358 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: eptr > md->start_used_ptr | 0-1 |
5359 | break; executed: break; Execution Count:1 | 1 |
5360 | } | - |
5361 | GETCHARLENTEST(c, eptr, len); executed: } Execution Count:1 partially evaluated: utf yes Evaluation Count:4 | no Evaluation Count:0 |
evaluated: (c & 0xfc00) == 0xd800 yes Evaluation Count:1 | yes Evaluation Count:3 |
| 0-4 |
5362 | if ((UCD_CHARTYPE(c) == prop_value) == prop_fail_result) break; never executed: break; partially evaluated: ((_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype == prop_value) == prop_fail_result no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
5363 | eptr+= len; executed (the execution status of this line is deduced): eptr+= len; | - |
5364 | } executed: } Execution Count:4 | 4 |
5365 | break; executed: break; Execution Count:1 | 1 |
5366 | | - |
5367 | case PT_SC: | - |
5368 | for (i = min; i < max; i++) | 0 |
5369 | { | - |
5370 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5371 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5372 | { | - |
5373 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5374 | break; | 0 |
5375 | } | - |
5376 | GETCHARLENTEST(c, eptr, len); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5377 | if ((UCD_SCRIPT(c) == prop_value) == prop_fail_result) break; never executed: break; never evaluated: ((_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->script == prop_value) == prop_fail_result | 0 |
5378 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5379 | } | 0 |
5380 | break; | 0 |
5381 | | - |
5382 | case PT_ALNUM: | - |
5383 | for (i = min; i < max; i++) | 0 |
5384 | { | - |
5385 | int category; never executed (the execution status of this line is deduced): int category; | - |
5386 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5387 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5388 | { | - |
5389 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5390 | break; | 0 |
5391 | } | - |
5392 | GETCHARLENTEST(c, eptr, len); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5393 | category = UCD_CATEGORY(c); never executed (the execution status of this line is deduced): category = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
5394 | if ((category == ucp_L || category == ucp_N) == prop_fail_result) never evaluated: (category == ucp_L || category == ucp_N) == prop_fail_result never evaluated: category == ucp_L never evaluated: category == ucp_N | 0 |
5395 | break; | 0 |
5396 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5397 | } | 0 |
5398 | break; | 0 |
5399 | | - |
5400 | case PT_SPACE: /* Perl space */ | - |
5401 | for (i = min; i < max; i++) | 0 |
5402 | { | - |
5403 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5404 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5405 | { | - |
5406 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5407 | break; | 0 |
5408 | } | - |
5409 | GETCHARLENTEST(c, eptr, len); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5410 | if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z never evaluated: c == '\011' never evaluated: c == '\012' | 0 |
5411 | c == CHAR_FF || c == CHAR_CR) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
5412 | == prop_fail_result) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\014' || c == '\015') == prop_fail_result | 0 |
5413 | break; | 0 |
5414 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5415 | } | 0 |
5416 | break; | 0 |
5417 | | - |
5418 | case PT_PXSPACE: /* POSIX space */ | - |
5419 | for (i = min; i < max; i++) | 0 |
5420 | { | - |
5421 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5422 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5423 | { | - |
5424 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5425 | break; | 0 |
5426 | } | - |
5427 | GETCHARLENTEST(c, eptr, len); never executed: } never evaluated: utf never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5428 | if ((UCD_CATEGORY(c) == ucp_Z || c == CHAR_HT || c == CHAR_NL || never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z never evaluated: c == '\011' never evaluated: c == '\012' | 0 |
5429 | c == CHAR_VT || c == CHAR_FF || c == CHAR_CR) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result never evaluated: c == '\013' never evaluated: c == '\014' never evaluated: c == '\015' | 0 |
5430 | == prop_fail_result) never evaluated: (_pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_Z || c == '\011' || c == '\012' || c == '\013' || c == '\014' || c == '\015') == prop_fail_result | 0 |
5431 | break; | 0 |
5432 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5433 | } | 0 |
5434 | break; | 0 |
5435 | | - |
5436 | case PT_WORD: | - |
5437 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
5438 | { | - |
5439 | int category; executed (the execution status of this line is deduced): int category; | - |
5440 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
5441 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
5442 | { | - |
5443 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5444 | break; | 0 |
5445 | } | - |
5446 | GETCHARLENTEST(c, eptr, len); never executed: } partially evaluated: utf yes Evaluation Count:5 | no Evaluation Count:0 |
partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
5447 | category = UCD_CATEGORY(c); executed (the execution status of this line is deduced): category = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype]; | - |
5448 | if ((category == ucp_L || category == ucp_N || evaluated: (category == ucp_L || category == ucp_N || c == '\137') == prop_fail_result yes Evaluation Count:1 | yes Evaluation Count:4 |
evaluated: category == ucp_L yes Evaluation Count:4 | yes Evaluation Count:1 |
partially evaluated: category == ucp_N no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-4 |
5449 | c == CHAR_UNDERSCORE) == prop_fail_result) evaluated: (category == ucp_L || category == ucp_N || c == '\137') == prop_fail_result yes Evaluation Count:1 | yes Evaluation Count:4 |
partially evaluated: c == '\137' no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-4 |
5450 | break; executed: break; Execution Count:1 | 1 |
5451 | eptr+= len; executed (the execution status of this line is deduced): eptr+= len; | - |
5452 | } executed: } Execution Count:4 | 4 |
5453 | break; executed: break; Execution Count:1 | 1 |
5454 | | - |
5455 | default: | - |
5456 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
5457 | } | - |
5458 | | - |
5459 | /* eptr is now past the end of the maximum run */ | - |
5460 | | - |
5461 | if (possessive) continue; never executed: continue; partially evaluated: possessive no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
5462 | for(;;) executed (the execution status of this line is deduced): for(;;) | - |
5463 | { | - |
5464 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM44); executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
5465 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:2 partially evaluated: rrc != 0 yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
5466 | if (eptr-- == pp) break; /* Stop if tried at original pos */ never executed: break; never evaluated: eptr-- == pp | 0 |
5467 | if (utf) BACKCHAR(eptr); never executed: eptr--; never evaluated: utf never evaluated: (*eptr & 0xfc00) == 0xdc00 | 0 |
5468 | } | 0 |
5469 | } | 0 |
5470 | | - |
5471 | /* Match extended Unicode sequences. We will get here only if the | - |
5472 | support is in the binary; otherwise a compile-time error occurs. */ | - |
5473 | | - |
5474 | else if (ctype == OP_EXTUNI) partially evaluated: ctype == OP_EXTUNI no Evaluation Count:0 | yes Evaluation Count:195 |
| 0-195 |
5475 | { | - |
5476 | for (i = min; i < max; i++) | 0 |
5477 | { | - |
5478 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5479 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5480 | { | - |
5481 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5482 | break; | 0 |
5483 | } | - |
5484 | if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } never executed: c = *eptr; never executed: } never executed: } never evaluated: (c & 0xfc00) == 0xd800 never evaluated: !utf | 0 |
5485 | if (UCD_CATEGORY(c) == ucp_M) break; never executed: break; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] == ucp_M | 0 |
5486 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
5487 | while (eptr < md->end_subject) never evaluated: eptr < md->end_subject | 0 |
5488 | { | - |
5489 | len = 1; never executed (the execution status of this line is deduced): len = 1; | - |
5490 | if (!utf) c = *eptr; else { GETCHARLEN(c, eptr, len); } never executed: c = *eptr; never executed: } never executed: } never evaluated: (c & 0xfc00) == 0xd800 never evaluated: !utf | 0 |
5491 | if (UCD_CATEGORY(c) != ucp_M) break; never executed: break; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M | 0 |
5492 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
5493 | } | 0 |
5494 | } | 0 |
5495 | | - |
5496 | /* eptr is now past the end of the maximum run */ | - |
5497 | | - |
5498 | if (possessive) continue; never executed: continue; never evaluated: possessive | 0 |
5499 | | - |
5500 | for(;;) never executed (the execution status of this line is deduced): for(;;) | - |
5501 | { | - |
5502 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM45); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
5503 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
5504 | if (eptr-- == pp) break; /* Stop if tried at original pos */ never executed: break; never evaluated: eptr-- == pp | 0 |
5505 | for (;;) /* Move back over one extended */ never executed (the execution status of this line is deduced): for (;;) | - |
5506 | { | - |
5507 | if (!utf) c = *eptr; else never executed: c = *eptr; never evaluated: !utf | 0 |
5508 | { | - |
5509 | BACKCHAR(eptr); never executed: eptr--; never evaluated: (*eptr & 0xfc00) == 0xdc00 | 0 |
5510 | GETCHAR(c, eptr); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5511 | } | 0 |
5512 | if (UCD_CATEGORY(c) != ucp_M) break; never executed: break; never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M | 0 |
5513 | eptr--; never executed (the execution status of this line is deduced): eptr--; | - |
5514 | } | 0 |
5515 | } | 0 |
5516 | } | 0 |
5517 | | - |
5518 | else | - |
5519 | #endif /* SUPPORT_UCP */ | - |
5520 | | - |
5521 | #ifdef SUPPORT_UTF | - |
5522 | if (utf) partially evaluated: utf yes Evaluation Count:195 | no Evaluation Count:0 |
| 0-195 |
5523 | { | - |
5524 | switch(ctype) | - |
5525 | { | - |
5526 | case OP_ANY: | - |
5527 | if (max < INT_MAX) partially evaluated: max < 2147483647 no Evaluation Count:0 | yes Evaluation Count:115 |
| 0-115 |
5528 | { | - |
5529 | for (i = min; i < max; i++) | 0 |
5530 | { | - |
5531 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5532 | { | - |
5533 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5534 | break; | 0 |
5535 | } | - |
5536 | if (IS_NEWLINE(eptr)) break; never executed: break; never evaluated: (md->nltype != 0) | 0 |
5537 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5538 | ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); never executed: eptr++; never evaluated: (eptr < md->end_subject) never evaluated: ((*eptr) & 0xfc00) == 0xdc00 | 0 |
5539 | } | 0 |
5540 | } | 0 |
5541 | | - |
5542 | /* Handle unlimited UTF-8 repeat */ | - |
5543 | | - |
5544 | else | - |
5545 | { | - |
5546 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:337 | no Evaluation Count:0 |
| 0-337 |
5547 | { | - |
5548 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:57 | yes Evaluation Count:280 |
| 57-280 |
5549 | { | - |
5550 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:57 |
never evaluated: eptr > md->start_used_ptr | 0-57 |
5551 | break; executed: break; Execution Count:57 | 57 |
5552 | } | - |
5553 | if (IS_NEWLINE(eptr)) break; executed: break; Execution Count:58 evaluated: (md->nltype != 0) yes Evaluation Count:29 | yes Evaluation Count:251 |
| 29-251 |
5554 | eptr++; executed (the execution status of this line is deduced): eptr++; | - |
5555 | ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); never executed: eptr++; evaluated: (eptr < md->end_subject) yes Evaluation Count:182 | yes Evaluation Count:40 |
partially evaluated: ((*eptr) & 0xfc00) == 0xdc00 no Evaluation Count:0 | yes Evaluation Count:182 |
| 0-182 |
5556 | } executed: } Execution Count:222 | 222 |
5557 | } executed: } Execution Count:115 | 115 |
5558 | break; executed: break; Execution Count:115 | 115 |
5559 | | - |
5560 | case OP_ALLANY: | - |
5561 | if (max < INT_MAX) partially evaluated: max < 2147483647 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
5562 | { | - |
5563 | for (i = min; i < max; i++) | 0 |
5564 | { | - |
5565 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5566 | { | - |
5567 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5568 | break; | 0 |
5569 | } | - |
5570 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5571 | ACROSSCHAR(eptr < md->end_subject, *eptr, eptr++); never executed: eptr++; never evaluated: (eptr < md->end_subject) never evaluated: ((*eptr) & 0xfc00) == 0xdc00 | 0 |
5572 | } | 0 |
5573 | } | 0 |
5574 | else | - |
5575 | { | - |
5576 | eptr = md->end_subject; /* Unlimited UTF-8 repeat */ executed (the execution status of this line is deduced): eptr = md->end_subject; | - |
5577 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: eptr > md->start_used_ptr | 0-1 |
5578 | } executed: } Execution Count:1 | 1 |
5579 | break; executed: break; Execution Count:1 | 1 |
5580 | | - |
5581 | /* The byte case is the same as non-UTF8 */ | - |
5582 | | - |
5583 | case OP_ANYBYTE: | - |
5584 | c = max - min; never executed (the execution status of this line is deduced): c = max - min; | - |
5585 | if (c > (unsigned int)(md->end_subject - eptr)) never evaluated: c > (unsigned int)(md->end_subject - eptr) | 0 |
5586 | { | - |
5587 | eptr = md->end_subject; never executed (the execution status of this line is deduced): eptr = md->end_subject; | - |
5588 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5589 | } | 0 |
5590 | else eptr += c; never executed: eptr += c; | 0 |
5591 | break; | 0 |
5592 | | - |
5593 | case OP_ANYNL: | - |
5594 | for (i = min; i < max; i++) | 0 |
5595 | { | - |
5596 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5597 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5598 | { | - |
5599 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5600 | break; | 0 |
5601 | } | - |
5602 | GETCHARLEN(c, eptr, len); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5603 | if (c == 0x000d) never evaluated: c == 0x000d | 0 |
5604 | { | - |
5605 | if (++eptr >= md->end_subject) break; never executed: break; never evaluated: ++eptr >= md->end_subject | 0 |
5606 | if (*eptr == 0x000a) eptr++; never executed: eptr++; never evaluated: *eptr == 0x000a | 0 |
5607 | } | 0 |
5608 | else | - |
5609 | { | - |
5610 | if (c != 0x000a && never evaluated: c != 0x000a | 0 |
5611 | (md->bsr_anycrlf || never evaluated: md->bsr_anycrlf | 0 |
5612 | (c != 0x000b && c != 0x000c && never evaluated: c != 0x000b never evaluated: c != 0x000c | 0 |
5613 | c != 0x0085 && c != 0x2028 && c != 0x2029))) never evaluated: c != 0x0085 never evaluated: c != 0x2028 never evaluated: c != 0x2029 | 0 |
5614 | break; | 0 |
5615 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
5616 | } | 0 |
5617 | } | - |
5618 | break; | 0 |
5619 | | - |
5620 | case OP_NOT_HSPACE: | - |
5621 | case OP_HSPACE: | - |
5622 | for (i = min; i < max; i++) | 0 |
5623 | { | - |
5624 | BOOL gotspace; never executed (the execution status of this line is deduced): BOOL gotspace; | - |
5625 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5626 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5627 | { | - |
5628 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5629 | break; | 0 |
5630 | } | - |
5631 | GETCHARLEN(c, eptr, len); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5632 | switch(c) | - |
5633 | { | - |
5634 | default: gotspace = FALSE; break; | 0 |
5635 | case 0x09: /* HT */ | - |
5636 | case 0x20: /* SPACE */ | - |
5637 | case 0xa0: /* NBSP */ | - |
5638 | case 0x1680: /* OGHAM SPACE MARK */ | - |
5639 | case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ | - |
5640 | case 0x2000: /* EN QUAD */ | - |
5641 | case 0x2001: /* EM QUAD */ | - |
5642 | case 0x2002: /* EN SPACE */ | - |
5643 | case 0x2003: /* EM SPACE */ | - |
5644 | case 0x2004: /* THREE-PER-EM SPACE */ | - |
5645 | case 0x2005: /* FOUR-PER-EM SPACE */ | - |
5646 | case 0x2006: /* SIX-PER-EM SPACE */ | - |
5647 | case 0x2007: /* FIGURE SPACE */ | - |
5648 | case 0x2008: /* PUNCTUATION SPACE */ | - |
5649 | case 0x2009: /* THIN SPACE */ | - |
5650 | case 0x200A: /* HAIR SPACE */ | - |
5651 | case 0x202f: /* NARROW NO-BREAK SPACE */ | - |
5652 | case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ | - |
5653 | case 0x3000: /* IDEOGRAPHIC SPACE */ | - |
5654 | gotspace = TRUE; never executed (the execution status of this line is deduced): gotspace = 1; | - |
5655 | break; | 0 |
5656 | } | - |
5657 | if (gotspace == (ctype == OP_NOT_HSPACE)) break; never executed: break; never evaluated: gotspace == (ctype == OP_NOT_HSPACE) | 0 |
5658 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
5659 | } | 0 |
5660 | break; | 0 |
5661 | | - |
5662 | case OP_NOT_VSPACE: | - |
5663 | case OP_VSPACE: | - |
5664 | for (i = min; i < max; i++) | 0 |
5665 | { | - |
5666 | BOOL gotspace; never executed (the execution status of this line is deduced): BOOL gotspace; | - |
5667 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5668 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5669 | { | - |
5670 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5671 | break; | 0 |
5672 | } | - |
5673 | GETCHARLEN(c, eptr, len); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5674 | switch(c) | - |
5675 | { | - |
5676 | default: gotspace = FALSE; break; | 0 |
5677 | case 0x0a: /* LF */ | - |
5678 | case 0x0b: /* VT */ | - |
5679 | case 0x0c: /* FF */ | - |
5680 | case 0x0d: /* CR */ | - |
5681 | case 0x85: /* NEL */ | - |
5682 | case 0x2028: /* LINE SEPARATOR */ | - |
5683 | case 0x2029: /* PARAGRAPH SEPARATOR */ | - |
5684 | gotspace = TRUE; never executed (the execution status of this line is deduced): gotspace = 1; | - |
5685 | break; | 0 |
5686 | } | - |
5687 | if (gotspace == (ctype == OP_NOT_VSPACE)) break; never executed: break; never evaluated: gotspace == (ctype == OP_NOT_VSPACE) | 0 |
5688 | eptr += len; never executed (the execution status of this line is deduced): eptr += len; | - |
5689 | } | 0 |
5690 | break; | 0 |
5691 | | - |
5692 | case OP_NOT_DIGIT: | - |
5693 | for (i = min; i < max; i++) | 0 |
5694 | { | - |
5695 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5696 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5697 | { | - |
5698 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5699 | break; | 0 |
5700 | } | - |
5701 | GETCHARLEN(c, eptr, len); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5702 | if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) break; never executed: break; never evaluated: c < 256 never evaluated: (md->ctypes[c] & 0x04) != 0 | 0 |
5703 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5704 | } | 0 |
5705 | break; | 0 |
5706 | | - |
5707 | case OP_DIGIT: | - |
5708 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:26 | no Evaluation Count:0 |
| 0-26 |
5709 | { | - |
5710 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
5711 | if (eptr >= md->end_subject) partially evaluated: eptr >= md->end_subject no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
5712 | { | - |
5713 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5714 | break; | 0 |
5715 | } | - |
5716 | GETCHARLEN(c, eptr, len); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:26 |
| 0-26 |
5717 | if (c >= 256 ||(md->ctypes[c] & ctype_digit) == 0) break; executed: break; Execution Count:12 partially evaluated: c >= 256 no Evaluation Count:0 | yes Evaluation Count:26 |
evaluated: (md->ctypes[c] & 0x04) == 0 yes Evaluation Count:12 | yes Evaluation Count:14 |
| 0-26 |
5718 | eptr+= len; executed (the execution status of this line is deduced): eptr+= len; | - |
5719 | } executed: } Execution Count:14 | 14 |
5720 | break; executed: break; Execution Count:12 | 12 |
5721 | | - |
5722 | case OP_NOT_WHITESPACE: | - |
5723 | for (i = min; i < max; i++) | 0 |
5724 | { | - |
5725 | int len = 1; never executed (the execution status of this line is deduced): int len = 1; | - |
5726 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5727 | { | - |
5728 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5729 | break; | 0 |
5730 | } | - |
5731 | GETCHARLEN(c, eptr, len); never executed: } never evaluated: (c & 0xfc00) == 0xd800 | 0 |
5732 | if (c < 256 && (md->ctypes[c] & ctype_space) != 0) break; never executed: break; never evaluated: c < 256 never evaluated: (md->ctypes[c] & 0x01) != 0 | 0 |
5733 | eptr+= len; never executed (the execution status of this line is deduced): eptr+= len; | - |
5734 | } | 0 |
5735 | break; | 0 |
5736 | | - |
5737 | case OP_WHITESPACE: | - |
5738 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:25 | no Evaluation Count:0 |
| 0-25 |
5739 | { | - |
5740 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
5741 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:1 | yes Evaluation Count:24 |
| 1-24 |
5742 | { | - |
5743 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: eptr > md->start_used_ptr | 0-1 |
5744 | break; executed: break; Execution Count:1 | 1 |
5745 | } | - |
5746 | GETCHARLEN(c, eptr, len); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
5747 | if (c >= 256 ||(md->ctypes[c] & ctype_space) == 0) break; executed: break; Execution Count:17 partially evaluated: c >= 256 no Evaluation Count:0 | yes Evaluation Count:24 |
evaluated: (md->ctypes[c] & 0x01) == 0 yes Evaluation Count:17 | yes Evaluation Count:7 |
| 0-24 |
5748 | eptr+= len; executed (the execution status of this line is deduced): eptr+= len; | - |
5749 | } executed: } Execution Count:7 | 7 |
5750 | break; executed: break; Execution Count:18 | 18 |
5751 | | - |
5752 | case OP_NOT_WORDCHAR: | - |
5753 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:14 | no Evaluation Count:0 |
| 0-14 |
5754 | { | - |
5755 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
5756 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:2 | yes Evaluation Count:12 |
| 2-12 |
5757 | { | - |
5758 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 partially evaluated: md->partial != 0 no Evaluation Count:0 | yes Evaluation Count:2 |
never evaluated: eptr > md->start_used_ptr | 0-2 |
5759 | break; executed: break; Execution Count:2 | 2 |
5760 | } | - |
5761 | GETCHARLEN(c, eptr, len); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
5762 | if (c < 256 && (md->ctypes[c] & ctype_word) != 0) break; executed: break; Execution Count:10 partially evaluated: c < 256 yes Evaluation Count:12 | no Evaluation Count:0 |
evaluated: (md->ctypes[c] & 0x10) != 0 yes Evaluation Count:10 | yes Evaluation Count:2 |
| 0-12 |
5763 | eptr+= len; executed (the execution status of this line is deduced): eptr+= len; | - |
5764 | } executed: } Execution Count:2 | 2 |
5765 | break; executed: break; Execution Count:12 | 12 |
5766 | | - |
5767 | case OP_WORDCHAR: | - |
5768 | for (i = min; i < max; i++) partially evaluated: i < max yes Evaluation Count:137 | no Evaluation Count:0 |
| 0-137 |
5769 | { | - |
5770 | int len = 1; executed (the execution status of this line is deduced): int len = 1; | - |
5771 | if (eptr >= md->end_subject) evaluated: eptr >= md->end_subject yes Evaluation Count:19 | yes Evaluation Count:118 |
| 19-118 |
5772 | { | - |
5773 | SCHECK_PARTIAL(); executed: return (-12); Execution Count:2 executed: } Execution Count:2 evaluated: md->partial > 1 yes Evaluation Count:2 | yes Evaluation Count:2 |
evaluated: md->partial != 0 yes Evaluation Count:4 | yes Evaluation Count:15 |
partially evaluated: eptr > md->start_used_ptr yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-15 |
5774 | break; executed: break; Execution Count:17 | 17 |
5775 | } | - |
5776 | GETCHARLEN(c, eptr, len); never executed: } partially evaluated: (c & 0xfc00) == 0xd800 no Evaluation Count:0 | yes Evaluation Count:118 |
| 0-118 |
5777 | if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) break; executed: break; Execution Count:18 partially evaluated: c >= 256 no Evaluation Count:0 | yes Evaluation Count:118 |
evaluated: (md->ctypes[c] & 0x10) == 0 yes Evaluation Count:18 | yes Evaluation Count:100 |
| 0-118 |
5778 | eptr+= len; executed (the execution status of this line is deduced): eptr+= len; | - |
5779 | } executed: } Execution Count:100 | 100 |
5780 | break; executed: break; Execution Count:35 | 35 |
5781 | | - |
5782 | default: | - |
5783 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
5784 | } | - |
5785 | | - |
5786 | /* eptr is now past the end of the maximum run. If possessive, we are | - |
5787 | done (no backing up). Otherwise, match at this position; anything other | - |
5788 | than no match is immediately returned. For nomatch, back up one | - |
5789 | character, unless we are matching \R and the last thing matched was | - |
5790 | \r\n, in which case, back up two bytes. */ | - |
5791 | | - |
5792 | if (possessive) continue; executed: continue; Execution Count:3 evaluated: possessive yes Evaluation Count:3 | yes Evaluation Count:190 |
| 3-190 |
5793 | for(;;) executed (the execution status of this line is deduced): for(;;) | - |
5794 | { | - |
5795 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM46); executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
5796 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); executed: return rrc; Execution Count:139 evaluated: rrc != 0 yes Evaluation Count:139 | yes Evaluation Count:129 |
| 129-139 |
5797 | if (eptr-- == pp) break; /* Stop if tried at original pos */ executed: break; Execution Count:51 evaluated: eptr-- == pp yes Evaluation Count:51 | yes Evaluation Count:78 |
| 51-78 |
5798 | BACKCHAR(eptr); never executed: eptr--; partially evaluated: (*eptr & 0xfc00) == 0xdc00 no Evaluation Count:0 | yes Evaluation Count:78 |
| 0-78 |
5799 | if (ctype == OP_ANYNL && eptr > pp && *eptr == '\n' && partially evaluated: ctype == OP_ANYNL no Evaluation Count:0 | yes Evaluation Count:78 |
never evaluated: eptr > pp never evaluated: *eptr == '\n' | 0-78 |
5800 | eptr[-1] == '\r') eptr--; never executed: eptr--; never evaluated: eptr[-1] == '\r' | 0 |
5801 | } executed: } Execution Count:78 | 78 |
5802 | } executed: } Execution Count:51 | 51 |
5803 | else | - |
5804 | #endif /* SUPPORT_UTF */ | - |
5805 | /* Not UTF mode */ | - |
5806 | { | - |
5807 | switch(ctype) | - |
5808 | { | - |
5809 | case OP_ANY: | - |
5810 | for (i = min; i < max; i++) | 0 |
5811 | { | - |
5812 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5813 | { | - |
5814 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5815 | break; | 0 |
5816 | } | - |
5817 | if (IS_NEWLINE(eptr)) break; never executed: break; never evaluated: (md->nltype != 0) | 0 |
5818 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5819 | } | 0 |
5820 | break; | 0 |
5821 | | - |
5822 | case OP_ALLANY: | - |
5823 | case OP_ANYBYTE: | - |
5824 | c = max - min; never executed (the execution status of this line is deduced): c = max - min; | - |
5825 | if (c > (unsigned int)(md->end_subject - eptr)) never evaluated: c > (unsigned int)(md->end_subject - eptr) | 0 |
5826 | { | - |
5827 | eptr = md->end_subject; never executed (the execution status of this line is deduced): eptr = md->end_subject; | - |
5828 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5829 | } | 0 |
5830 | else eptr += c; never executed: eptr += c; | 0 |
5831 | break; | 0 |
5832 | | - |
5833 | case OP_ANYNL: | - |
5834 | for (i = min; i < max; i++) | 0 |
5835 | { | - |
5836 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5837 | { | - |
5838 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5839 | break; | 0 |
5840 | } | - |
5841 | c = *eptr; never executed (the execution status of this line is deduced): c = *eptr; | - |
5842 | if (c == 0x000d) never evaluated: c == 0x000d | 0 |
5843 | { | - |
5844 | if (++eptr >= md->end_subject) break; never executed: break; never evaluated: ++eptr >= md->end_subject | 0 |
5845 | if (*eptr == 0x000a) eptr++; never executed: eptr++; never evaluated: *eptr == 0x000a | 0 |
5846 | } | 0 |
5847 | else | - |
5848 | { | - |
5849 | if (c != 0x000a && (md->bsr_anycrlf || never evaluated: c != 0x000a never evaluated: md->bsr_anycrlf | 0 |
5850 | (c != 0x000b && c != 0x000c && c != 0x0085 never evaluated: c != 0x000b never evaluated: c != 0x000c never evaluated: c != 0x0085 | 0 |
5851 | #ifdef COMPILE_PCRE16 never executed (the execution status of this line is deduced):
| - |
5852 | && c != 0x2028 && c != 0x2029 never evaluated: c != 0x2028 never evaluated: c != 0x2029 | 0 |
5853 | #endif never executed (the execution status of this line is deduced):
| - |
5854 | ))) break; | 0 |
5855 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5856 | } | 0 |
5857 | } | - |
5858 | break; | 0 |
5859 | | - |
5860 | case OP_NOT_HSPACE: | - |
5861 | for (i = min; i < max; i++) | 0 |
5862 | { | - |
5863 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5864 | { | - |
5865 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5866 | break; | 0 |
5867 | } | - |
5868 | c = *eptr; never executed (the execution status of this line is deduced): c = *eptr; | - |
5869 | if (c == 0x09 || c == 0x20 || c == 0xa0 never evaluated: c == 0x09 never evaluated: c == 0x20 never evaluated: c == 0xa0 | 0 |
5870 | #ifdef COMPILE_PCRE16 never executed (the execution status of this line is deduced):
| - |
5871 | || c == 0x1680 || c == 0x180e || (c >= 0x2000 && c <= 0x200A) never evaluated: c == 0x1680 never evaluated: c == 0x180e never evaluated: c >= 0x2000 never evaluated: c <= 0x200A | 0 |
5872 | || c == 0x202f || c == 0x205f || c == 0x3000 never evaluated: c == 0x202f never evaluated: c == 0x205f never evaluated: c == 0x3000 | 0 |
5873 | #endif | - |
5874 | ) break; | 0 |
5875 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5876 | } | 0 |
5877 | break; | 0 |
5878 | | - |
5879 | case OP_HSPACE: | - |
5880 | for (i = min; i < max; i++) | 0 |
5881 | { | - |
5882 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5883 | { | - |
5884 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5885 | break; | 0 |
5886 | } | - |
5887 | c = *eptr; never executed (the execution status of this line is deduced): c = *eptr; | - |
5888 | if (c != 0x09 && c != 0x20 && c != 0xa0 never evaluated: c != 0x09 never evaluated: c != 0x20 never evaluated: c != 0xa0 | 0 |
5889 | #ifdef COMPILE_PCRE16 never executed (the execution status of this line is deduced):
| - |
5890 | && c != 0x1680 && c != 0x180e && (c < 0x2000 || c > 0x200A) never evaluated: c != 0x1680 never evaluated: c != 0x180e never evaluated: c < 0x2000 never evaluated: c > 0x200A | 0 |
5891 | && c != 0x202f && c != 0x205f && c != 0x3000 never evaluated: c != 0x202f never evaluated: c != 0x205f never evaluated: c != 0x3000 | 0 |
5892 | #endif | - |
5893 | ) break; | 0 |
5894 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5895 | } | 0 |
5896 | break; | 0 |
5897 | | - |
5898 | case OP_NOT_VSPACE: | - |
5899 | for (i = min; i < max; i++) | 0 |
5900 | { | - |
5901 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5902 | { | - |
5903 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5904 | break; | 0 |
5905 | } | - |
5906 | c = *eptr; never executed (the execution status of this line is deduced): c = *eptr; | - |
5907 | if (c == 0x0a || c == 0x0b || c == 0x0c || c == 0x0d || c == 0x85 never evaluated: c == 0x0a never evaluated: c == 0x0b never evaluated: c == 0x0c never evaluated: c == 0x0d never evaluated: c == 0x85 | 0 |
5908 | #ifdef COMPILE_PCRE16 never executed (the execution status of this line is deduced):
| - |
5909 | || c == 0x2028 || c == 0x2029 never evaluated: c == 0x2028 never evaluated: c == 0x2029 | 0 |
5910 | #endif | - |
5911 | ) break; | 0 |
5912 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5913 | } | 0 |
5914 | break; | 0 |
5915 | | - |
5916 | case OP_VSPACE: | - |
5917 | for (i = min; i < max; i++) | 0 |
5918 | { | - |
5919 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5920 | { | - |
5921 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5922 | break; | 0 |
5923 | } | - |
5924 | c = *eptr; never executed (the execution status of this line is deduced): c = *eptr; | - |
5925 | if (c != 0x0a && c != 0x0b && c != 0x0c && c != 0x0d && c != 0x85 never evaluated: c != 0x0a never evaluated: c != 0x0b never evaluated: c != 0x0c never evaluated: c != 0x0d never evaluated: c != 0x85 | 0 |
5926 | #ifdef COMPILE_PCRE16 never executed (the execution status of this line is deduced):
| - |
5927 | && c != 0x2028 && c != 0x2029 never evaluated: c != 0x2028 never evaluated: c != 0x2029 | 0 |
5928 | #endif | - |
5929 | ) break; | 0 |
5930 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5931 | } | 0 |
5932 | break; | 0 |
5933 | | - |
5934 | case OP_NOT_DIGIT: | - |
5935 | for (i = min; i < max; i++) | 0 |
5936 | { | - |
5937 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5938 | { | - |
5939 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5940 | break; | 0 |
5941 | } | - |
5942 | if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_digit) != 0) break; never executed: break; never evaluated: ((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x04) != 0 | 0 |
5943 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5944 | } | 0 |
5945 | break; | 0 |
5946 | | - |
5947 | case OP_DIGIT: | - |
5948 | for (i = min; i < max; i++) | 0 |
5949 | { | - |
5950 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5951 | { | - |
5952 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5953 | break; | 0 |
5954 | } | - |
5955 | if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_digit) == 0) break; never executed: break; never evaluated: !((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x04) == 0 | 0 |
5956 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5957 | } | 0 |
5958 | break; | 0 |
5959 | | - |
5960 | case OP_NOT_WHITESPACE: | - |
5961 | for (i = min; i < max; i++) | 0 |
5962 | { | - |
5963 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5964 | { | - |
5965 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5966 | break; | 0 |
5967 | } | - |
5968 | if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_space) != 0) break; never executed: break; never evaluated: ((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x01) != 0 | 0 |
5969 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5970 | } | 0 |
5971 | break; | 0 |
5972 | | - |
5973 | case OP_WHITESPACE: | - |
5974 | for (i = min; i < max; i++) | 0 |
5975 | { | - |
5976 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5977 | { | - |
5978 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5979 | break; | 0 |
5980 | } | - |
5981 | if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_space) == 0) break; never executed: break; never evaluated: !((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x01) == 0 | 0 |
5982 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5983 | } | 0 |
5984 | break; | 0 |
5985 | | - |
5986 | case OP_NOT_WORDCHAR: | - |
5987 | for (i = min; i < max; i++) | 0 |
5988 | { | - |
5989 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
5990 | { | - |
5991 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
5992 | break; | 0 |
5993 | } | - |
5994 | if (MAX_255(*eptr) && (md->ctypes[*eptr] & ctype_word) != 0) break; never executed: break; never evaluated: ((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x10) != 0 | 0 |
5995 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
5996 | } | 0 |
5997 | break; | 0 |
5998 | | - |
5999 | case OP_WORDCHAR: | - |
6000 | for (i = min; i < max; i++) | 0 |
6001 | { | - |
6002 | if (eptr >= md->end_subject) never evaluated: eptr >= md->end_subject | 0 |
6003 | { | - |
6004 | SCHECK_PARTIAL(); never executed: return (-12); never executed: } never evaluated: md->partial > 1 never evaluated: md->partial != 0 never evaluated: eptr > md->start_used_ptr | 0 |
6005 | break; | 0 |
6006 | } | - |
6007 | if (!MAX_255(*eptr) || (md->ctypes[*eptr] & ctype_word) == 0) break; never executed: break; never evaluated: !((*eptr) <= 255u) never evaluated: (md->ctypes[*eptr] & 0x10) == 0 | 0 |
6008 | eptr++; never executed (the execution status of this line is deduced): eptr++; | - |
6009 | } | 0 |
6010 | break; | 0 |
6011 | | - |
6012 | default: | - |
6013 | RRETURN(PCRE_ERROR_INTERNAL); never executed: return (-14); | 0 |
6014 | } | - |
6015 | | - |
6016 | /* eptr is now past the end of the maximum run. If possessive, we are | - |
6017 | done (no backing up). Otherwise, match at this position; anything other | - |
6018 | than no match is immediately returned. For nomatch, back up one | - |
6019 | character (byte), unless we are matching \R and the last thing matched | - |
6020 | was \r\n, in which case, back up two bytes. */ | - |
6021 | | - |
6022 | if (possessive) continue; never executed: continue; never evaluated: possessive | 0 |
6023 | while (eptr >= pp) never evaluated: eptr >= pp | 0 |
6024 | { | - |
6025 | RMATCH(eptr, ecode, offset_top, md, eptrb, RM47); never executed (the execution status of this line is deduced): rrc = match(eptr,ecode,mstart,offset_top,md,eptrb,rdepth+1); | - |
6026 | if (rrc != MATCH_NOMATCH) RRETURN(rrc); never executed: return rrc; never evaluated: rrc != 0 | 0 |
6027 | eptr--; never executed (the execution status of this line is deduced): eptr--; | - |
6028 | if (ctype == OP_ANYNL && eptr > pp && *eptr == '\n' && never evaluated: ctype == OP_ANYNL never evaluated: eptr > pp never evaluated: *eptr == '\n' | 0 |
6029 | eptr[-1] == '\r') eptr--; never executed: eptr--; never evaluated: eptr[-1] == '\r' | 0 |
6030 | } | 0 |
6031 | } | 0 |
6032 | | - |
6033 | /* Get here if we can't make it match with any permitted repetitions */ | - |
6034 | | - |
6035 | RRETURN(MATCH_NOMATCH); executed: return 0; Execution Count:51 | 51 |
6036 | } | - |
6037 | /* Control never gets here */ | - |
6038 | | - |
6039 | /* There's been some horrible disaster. Arrival here can only mean there is | - |
6040 | something seriously wrong in the code above or the OP_xxx definitions. */ | - |
6041 | | - |
6042 | default: code before this statement never executed: default: | 0 |
6043 | DPRINTF(("Unknown opcode %d\n", *ecode)); | - |
6044 | RRETURN(PCRE_ERROR_UNKNOWN_OPCODE); never executed: return (-5); | 0 |
6045 | } | - |
6046 | | - |
6047 | /* Do not stick any code in here without much thought; it is assumed | - |
6048 | that "continue" in the code above comes out to here to repeat the main | - |
6049 | loop. */ | - |
6050 | | - |
6051 | } /* End of main loop */ executed: } Execution Count:3536 | 3536 |
6052 | /* Control never reaches here */ | - |
6053 | | - |
6054 | | - |
6055 | /* When compiling to use the heap rather than the stack for recursive calls to | - |
6056 | match(), the RRETURN() macro jumps here. The number that is saved in | - |
6057 | frame->Xwhere indicates which label we actually want to return to. */ | - |
6058 | | - |
6059 | #ifdef NO_RECURSE | - |
6060 | #define LBL(val) case val: goto L_RM##val; | - |
6061 | HEAP_RETURN: | - |
6062 | switch (frame->Xwhere) | - |
6063 | { | - |
6064 | LBL( 1) LBL( 2) LBL( 3) LBL( 4) LBL( 5) LBL( 6) LBL( 7) LBL( 8) | - |
6065 | LBL( 9) LBL(10) LBL(11) LBL(12) LBL(13) LBL(14) LBL(15) LBL(17) | - |
6066 | LBL(19) LBL(24) LBL(25) LBL(26) LBL(27) LBL(29) LBL(31) LBL(33) | - |
6067 | LBL(35) LBL(43) LBL(47) LBL(48) LBL(49) LBL(50) LBL(51) LBL(52) | - |
6068 | LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) LBL(63) LBL(64) | - |
6069 | LBL(65) LBL(66) | - |
6070 | #if defined SUPPORT_UTF || !defined COMPILE_PCRE8 | - |
6071 | LBL(21) | - |
6072 | #endif | - |
6073 | #ifdef SUPPORT_UTF | - |
6074 | LBL(16) LBL(18) LBL(20) | - |
6075 | LBL(22) LBL(23) LBL(28) LBL(30) | - |
6076 | LBL(32) LBL(34) LBL(42) LBL(46) | - |
6077 | #ifdef SUPPORT_UCP | - |
6078 | LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45) | - |
6079 | LBL(59) LBL(60) LBL(61) LBL(62) | - |
6080 | #endif /* SUPPORT_UCP */ | - |
6081 | #endif /* SUPPORT_UTF */ | - |
6082 | default: | - |
6083 | DPRINTF(("jump error in pcre match: label %d non-existent\n", frame->Xwhere)); | - |
6084 | | - |
6085 | printf("+++jump error in pcre match: label %d non-existent\n", frame->Xwhere); | - |
6086 | | - |
6087 | return PCRE_ERROR_INTERNAL; | - |
6088 | } | - |
6089 | #undef LBL | - |
6090 | #endif /* NO_RECURSE */ | - |
6091 | } | 0 |
6092 | | - |
6093 | | - |
6094 | /*************************************************************************** | - |
6095 | **************************************************************************** | - |
6096 | RECURSION IN THE match() FUNCTION | - |
6097 | | - |
6098 | Undefine all the macros that were defined above to handle this. */ | - |
6099 | | - |
6100 | #ifdef NO_RECURSE | - |
6101 | #undef eptr | - |
6102 | #undef ecode | - |
6103 | #undef mstart | - |
6104 | #undef offset_top | - |
6105 | #undef eptrb | - |
6106 | #undef flags | - |
6107 | | - |
6108 | #undef callpat | - |
6109 | #undef charptr | - |
6110 | #undef data | - |
6111 | #undef next | - |
6112 | #undef pp | - |
6113 | #undef prev | - |
6114 | #undef saved_eptr | - |
6115 | | - |
6116 | #undef new_recursive | - |
6117 | | - |
6118 | #undef cur_is_word | - |
6119 | #undef condition | - |
6120 | #undef prev_is_word | - |
6121 | | - |
6122 | #undef ctype | - |
6123 | #undef length | - |
6124 | #undef max | - |
6125 | #undef min | - |
6126 | #undef number | - |
6127 | #undef offset | - |
6128 | #undef op | - |
6129 | #undef save_capture_last | - |
6130 | #undef save_offset1 | - |
6131 | #undef save_offset2 | - |
6132 | #undef save_offset3 | - |
6133 | #undef stacksave | - |
6134 | | - |
6135 | #undef newptrb | - |
6136 | | - |
6137 | #endif | - |
6138 | | - |
6139 | /* These two are defined as macros in both cases */ | - |
6140 | | - |
6141 | #undef fc | - |
6142 | #undef fi | - |
6143 | | - |
6144 | /*************************************************************************** | - |
6145 | ***************************************************************************/ | - |
6146 | | - |
6147 | | - |
6148 | | - |
6149 | /************************************************* | - |
6150 | * Execute a Regular Expression * | - |
6151 | *************************************************/ | - |
6152 | | - |
6153 | /* This function applies a compiled re to a subject string and picks out | - |
6154 | portions of the string if it matches. Two elements in the vector are set for | - |
6155 | each substring: the offsets to the start and end of the substring. | - |
6156 | | - |
6157 | Arguments: | - |
6158 | argument_re points to the compiled expression | - |
6159 | extra_data points to extra data or is NULL | - |
6160 | subject points to the subject string | - |
6161 | length length of subject string (may contain binary zeros) | - |
6162 | start_offset where to start in the subject string | - |
6163 | options option bits | - |
6164 | offsets points to a vector of ints to be filled in with offsets | - |
6165 | offsetcount the number of elements in the vector | - |
6166 | | - |
6167 | Returns: > 0 => success; value is the number of elements filled in | - |
6168 | = 0 => success, but offsets is not big enough | - |
6169 | -1 => failed to match | - |
6170 | < -1 => some kind of unexpected problem | - |
6171 | */ | - |
6172 | | - |
6173 | #ifdef COMPILE_PCRE8 | - |
6174 | PCRE_EXP_DEFN int PCRE_CALL_CONVENTION | - |
6175 | pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, | - |
6176 | PCRE_SPTR subject, int length, int start_offset, int options, int *offsets, | - |
6177 | int offsetcount) | - |
6178 | #else | - |
6179 | PCRE_EXP_DEFN int PCRE_CALL_CONVENTION | - |
6180 | pcre16_exec(const pcre16 *argument_re, const pcre16_extra *extra_data, | - |
6181 | PCRE_SPTR16 subject, int length, int start_offset, int options, int *offsets, | - |
6182 | int offsetcount) | - |
6183 | #endif | - |
6184 | { | - |
6185 | int rc, ocount, arg_offset_max; executed (the execution status of this line is deduced): int rc, ocount, arg_offset_max; | - |
6186 | int newline; executed (the execution status of this line is deduced): int newline; | - |
6187 | BOOL using_temporary_offsets = FALSE; executed (the execution status of this line is deduced): BOOL using_temporary_offsets = 0; | - |
6188 | BOOL anchored; executed (the execution status of this line is deduced): BOOL anchored; | - |
6189 | BOOL startline; executed (the execution status of this line is deduced): BOOL startline; | - |
6190 | BOOL firstline; executed (the execution status of this line is deduced): BOOL firstline; | - |
6191 | BOOL utf; executed (the execution status of this line is deduced): BOOL utf; | - |
6192 | BOOL has_first_char = FALSE; executed (the execution status of this line is deduced): BOOL has_first_char = 0; | - |
6193 | BOOL has_req_char = FALSE; executed (the execution status of this line is deduced): BOOL has_req_char = 0; | - |
6194 | pcre_uchar first_char = 0; executed (the execution status of this line is deduced): pcre_uchar first_char = 0; | - |
6195 | pcre_uchar first_char2 = 0; executed (the execution status of this line is deduced): pcre_uchar first_char2 = 0; | - |
6196 | pcre_uchar req_char = 0; executed (the execution status of this line is deduced): pcre_uchar req_char = 0; | - |
6197 | pcre_uchar req_char2 = 0; executed (the execution status of this line is deduced): pcre_uchar req_char2 = 0; | - |
6198 | match_data match_block; executed (the execution status of this line is deduced): match_data match_block; | - |
6199 | match_data *md = &match_block; executed (the execution status of this line is deduced): match_data *md = &match_block; | - |
6200 | const pcre_uint8 *tables; executed (the execution status of this line is deduced): const pcre_uint8 *tables; | - |
6201 | const pcre_uint8 *start_bits = NULL; executed (the execution status of this line is deduced): const pcre_uint8 *start_bits = ((void *)0); | - |
6202 | PCRE_PUCHAR start_match = (PCRE_PUCHAR)subject + start_offset; executed (the execution status of this line is deduced): const pcre_uchar * start_match = (const pcre_uchar *)subject + start_offset; | - |
6203 | PCRE_PUCHAR end_subject; executed (the execution status of this line is deduced): const pcre_uchar * end_subject; | - |
6204 | PCRE_PUCHAR start_partial = NULL; executed (the execution status of this line is deduced): const pcre_uchar * start_partial = ((void *)0); | - |
6205 | PCRE_PUCHAR req_char_ptr = start_match - 1; executed (the execution status of this line is deduced): const pcre_uchar * req_char_ptr = start_match - 1; | - |
6206 | | - |
6207 | const pcre_study_data *study; executed (the execution status of this line is deduced): const pcre_study_data *study; | - |
6208 | const REAL_PCRE *re = (const REAL_PCRE *)argument_re; executed (the execution status of this line is deduced): const real_pcre16 *re = (const real_pcre16 *)argument_re; | - |
6209 | | - |
6210 | /* Check for the special magic call that measures the size of the stack used | - |
6211 | per recursive call of match(). */ | - |
6212 | | - |
6213 | if (re == NULL && extra_data == NULL && subject == NULL && length == -999 && partially evaluated: re == ((void *)0) no Evaluation Count:0 | yes Evaluation Count:990 |
never evaluated: extra_data == ((void *)0) never evaluated: subject == ((void *)0) never evaluated: length == -999 | 0-990 |
6214 | start_offset == -999) never evaluated: start_offset == -999 | 0 |
6215 | #ifdef NO_RECURSE | - |
6216 | return -sizeof(heapframe); | - |
6217 | #else | - |
6218 | return match(NULL, NULL, NULL, 0, NULL, NULL, 0); never executed: return match(((void *)0), ((void *)0), ((void *)0), 0, ((void *)0), ((void *)0), 0); | 0 |
6219 | #endif | - |
6220 | | - |
6221 | /* Plausibility checks */ | - |
6222 | | - |
6223 | if ((options & ~PUBLIC_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION; never executed: return (-3); partially evaluated: (options & ~(0x00000010|0x00000080|0x00000100|0x00000400|0x10000000| 0x00002000|0x08000000|0x00008000|(0x00100000|0x00200000|0x00400000| 0x00500000)| 0x00800000|0x01000000|0x04000000)) != 0 no Evaluation Count:0 | yes Evaluation Count:990 |
| 0-990 |
6224 | if (re == NULL || subject == NULL || (offsets == NULL && offsetcount > 0)) partially evaluated: re == ((void *)0) no Evaluation Count:0 | yes Evaluation Count:990 |
partially evaluated: subject == ((void *)0) no Evaluation Count:0 | yes Evaluation Count:990 |
partially evaluated: offsets == ((void *)0) no Evaluation Count:0 | yes Evaluation Count:990 |
never evaluated: offsetcount > 0 | 0-990 |
6225 | return PCRE_ERROR_NULL; never executed: return (-2); | 0 |
6226 | if (offsetcount < 0) return PCRE_ERROR_BADCOUNT; never executed: return (-15); partially evaluated: offsetcount < 0 no Evaluation Count:0 | yes Evaluation Count:990 |
| 0-990 |
6227 | if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET; executed: return (-24); Execution Count:24 partially evaluated: start_offset < 0 no Evaluation Count:0 | yes Evaluation Count:990 |
evaluated: start_offset > length yes Evaluation Count:24 | yes Evaluation Count:966 |
| 0-990 |
6228 | | - |
6229 | /* Check that the first field in the block is the magic number. If it is not, | - |
6230 | return with PCRE_ERROR_BADMAGIC. However, if the magic number is equal to | - |
6231 | REVERSED_MAGIC_NUMBER we return with PCRE_ERROR_BADENDIANNESS, which | - |
6232 | means that the pattern is likely compiled with different endianness. */ | - |
6233 | | - |
6234 | if (re->magic_number != MAGIC_NUMBER) partially evaluated: re->magic_number != 0x50435245UL no Evaluation Count:0 | yes Evaluation Count:966 |
| 0-966 |
6235 | return re->magic_number == REVERSED_MAGIC_NUMBER? never executed: return re->magic_number == 0x45524350UL? (-29):(-4); | 0 |
6236 | PCRE_ERROR_BADENDIANNESS:PCRE_ERROR_BADMAGIC; never executed: return re->magic_number == 0x45524350UL? (-29):(-4); | 0 |
6237 | if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE; never executed: return (-28); partially evaluated: (re->flags & 0x0002) == 0 no Evaluation Count:0 | yes Evaluation Count:966 |
| 0-966 |
6238 | | - |
6239 | /* These two settings are used in the code for checking a UTF-8 string that | - |
6240 | follows immediately afterwards. Other values in the md block are used only | - |
6241 | during "normal" pcre_exec() processing, not when the JIT support is in use, | - |
6242 | so they are set up later. */ | - |
6243 | | - |
6244 | /* PCRE_UTF16 has the same value as PCRE_UTF8. */ | - |
6245 | utf = md->utf = (re->options & PCRE_UTF8) != 0; executed (the execution status of this line is deduced): utf = md->utf = (re->options & 0x00000800) != 0; | - |
6246 | md->partial = ((options & PCRE_PARTIAL_HARD) != 0)? 2 : evaluated: ((options & 0x08000000) != 0) yes Evaluation Count:13 | yes Evaluation Count:953 |
| 13-953 |
6247 | ((options & PCRE_PARTIAL_SOFT) != 0)? 1 : 0; executed (the execution status of this line is deduced): ((options & 0x00008000) != 0)? 1 : 0; | - |
6248 | | - |
6249 | /* Check a UTF-8 string if required. Pass back the character offset and error | - |
6250 | code for an invalid string if a results vector is available. */ | - |
6251 | | - |
6252 | #ifdef SUPPORT_UTF | - |
6253 | if (utf && (options & PCRE_NO_UTF8_CHECK) == 0) partially evaluated: utf yes Evaluation Count:966 | no Evaluation Count:0 |
evaluated: (options & 0x00002000) == 0 yes Evaluation Count:333 | yes Evaluation Count:633 |
| 0-966 |
6254 | { | - |
6255 | int erroroffset; executed (the execution status of this line is deduced): int erroroffset; | - |
6256 | int errorcode = PRIV(valid_utf)((PCRE_PUCHAR)subject, length, &erroroffset); executed (the execution status of this line is deduced): int errorcode = _pcre16_valid_utf((const pcre_uchar *)subject, length, &erroroffset); | - |
6257 | if (errorcode != 0) partially evaluated: errorcode != 0 no Evaluation Count:0 | yes Evaluation Count:333 |
| 0-333 |
6258 | { | - |
6259 | if (offsetcount >= 2) never evaluated: offsetcount >= 2 | 0 |
6260 | { | - |
6261 | offsets[0] = erroroffset; never executed (the execution status of this line is deduced): offsets[0] = erroroffset; | - |
6262 | offsets[1] = errorcode; never executed (the execution status of this line is deduced): offsets[1] = errorcode; | - |
6263 | } | 0 |
6264 | #ifdef COMPILE_PCRE16 | - |
6265 | return (errorcode <= PCRE_UTF16_ERR1 && md->partial > 1)? never executed: return (errorcode <= 1 && md->partial > 1)? (-25) : (-10); | 0 |
6266 | PCRE_ERROR_SHORTUTF16 : PCRE_ERROR_BADUTF16; never executed: return (errorcode <= 1 && md->partial > 1)? (-25) : (-10); | 0 |
6267 | #else | - |
6268 | return (errorcode <= PCRE_UTF8_ERR5 && md->partial > 1)? | - |
6269 | PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8; | - |
6270 | #endif | - |
6271 | } | - |
6272 | | - |
6273 | /* Check that a start_offset points to the start of a UTF character. */ | - |
6274 | if (start_offset > 0 && start_offset < length && evaluated: start_offset > 0 yes Evaluation Count:36 | yes Evaluation Count:297 |
evaluated: start_offset < length yes Evaluation Count:34 | yes Evaluation Count:2 |
| 2-297 |
6275 | NOT_FIRSTCHAR(((PCRE_PUCHAR)subject)[start_offset])) partially evaluated: (((((const pcre_uchar *)subject)[start_offset]) & 0xfc00) == 0xdc00) no Evaluation Count:0 | yes Evaluation Count:34 |
| 0-34 |
6276 | return PCRE_ERROR_BADUTF8_OFFSET; never executed: return (-11); | 0 |
6277 | } executed: } Execution Count:333 | 333 |
6278 | #endif | - |
6279 | | - |
6280 | /* If the pattern was successfully studied with JIT support, run the JIT | - |
6281 | executable instead of the rest of this function. Most options must be set at | - |
6282 | compile time for the JIT code to be usable. Fallback to the normal code path if | - |
6283 | an unsupported flag is set. In particular, JIT does not support partial | - |
6284 | matching. */ | - |
6285 | | - |
6286 | #ifdef SUPPORT_JIT | - |
6287 | if (extra_data != NULL evaluated: extra_data != ((void *)0) yes Evaluation Count:204 | yes Evaluation Count:762 |
| 204-762 |
6288 | && (extra_data->flags & PCRE_EXTRA_EXECUTABLE_JIT) != 0 partially evaluated: (extra_data->flags & 0x0040) != 0 yes Evaluation Count:204 | no Evaluation Count:0 |
| 0-204 |
6289 | && extra_data->executable_jit != NULL partially evaluated: extra_data->executable_jit != ((void *)0) yes Evaluation Count:204 | no Evaluation Count:0 |
| 0-204 |
6290 | && (extra_data->flags & PCRE_EXTRA_TABLES) == 0 partially evaluated: (extra_data->flags & 0x0008) == 0 yes Evaluation Count:204 | no Evaluation Count:0 |
| 0-204 |
6291 | && (options & ~(PCRE_NO_UTF8_CHECK | PCRE_NOTBOL | PCRE_NOTEOL | evaluated: (options & ~(0x00002000 | 0x00000080 | 0x00000100 | 0x00000400 | 0x10000000)) == 0 yes Evaluation Count:172 | yes Evaluation Count:32 |
| 32-172 |
6292 | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART)) == 0) evaluated: (options & ~(0x00002000 | 0x00000080 | 0x00000100 | 0x00000400 | 0x10000000)) == 0 yes Evaluation Count:172 | yes Evaluation Count:32 |
| 32-172 |
6293 | return PRIV(jit_exec)(re, extra_data->executable_jit, executed: return _pcre16_jit_exec(re, extra_data->executable_jit, (const pcre_uchar *)subject, length, start_offset, options, ((extra_data->flags & 0x0002) == 0) ? 10000000 : extra_data->match_limit, offsets, offsetcount); Execution Count:172 | 172 |
6294 | (const pcre_uchar *)subject, length, start_offset, options, executed: return _pcre16_jit_exec(re, extra_data->executable_jit, (const pcre_uchar *)subject, length, start_offset, options, ((extra_data->flags & 0x0002) == 0) ? 10000000 : extra_data->match_limit, offsets, offsetcount); Execution Count:172 | 172 |
6295 | ((extra_data->flags & PCRE_EXTRA_MATCH_LIMIT) == 0) executed: return _pcre16_jit_exec(re, extra_data->executable_jit, (const pcre_uchar *)subject, length, start_offset, options, ((extra_data->flags & 0x0002) == 0) ? 10000000 : extra_data->match_limit, offsets, offsetcount); Execution Count:172 | 172 |
6296 | ? MATCH_LIMIT : extra_data->match_limit, offsets, offsetcount); executed: return _pcre16_jit_exec(re, extra_data->executable_jit, (const pcre_uchar *)subject, length, start_offset, options, ((extra_data->flags & 0x0002) == 0) ? 10000000 : extra_data->match_limit, offsets, offsetcount); Execution Count:172 | 172 |
6297 | #endif | - |
6298 | | - |
6299 | /* Carry on with non-JIT matching. This information is for finding all the | - |
6300 | numbers associated with a given name, for condition testing. */ | - |
6301 | | - |
6302 | md->name_table = (pcre_uchar *)re + re->name_table_offset; executed (the execution status of this line is deduced): md->name_table = (pcre_uchar *)re + re->name_table_offset; | - |
6303 | md->name_count = re->name_count; executed (the execution status of this line is deduced): md->name_count = re->name_count; | - |
6304 | md->name_entry_size = re->name_entry_size; executed (the execution status of this line is deduced): md->name_entry_size = re->name_entry_size; | - |
6305 | | - |
6306 | /* Fish out the optional data from the extra_data structure, first setting | - |
6307 | the default values. */ | - |
6308 | | - |
6309 | study = NULL; executed (the execution status of this line is deduced): study = ((void *)0); | - |
6310 | md->match_limit = MATCH_LIMIT; executed (the execution status of this line is deduced): md->match_limit = 10000000; | - |
6311 | md->match_limit_recursion = MATCH_LIMIT_RECURSION; executed (the execution status of this line is deduced): md->match_limit_recursion = 10000000; | - |
6312 | md->callout_data = NULL; executed (the execution status of this line is deduced): md->callout_data = ((void *)0); | - |
6313 | | - |
6314 | /* The table pointer is always in native byte order. */ | - |
6315 | | - |
6316 | tables = re->tables; executed (the execution status of this line is deduced): tables = re->tables; | - |
6317 | | - |
6318 | if (extra_data != NULL) evaluated: extra_data != ((void *)0) yes Evaluation Count:32 | yes Evaluation Count:762 |
| 32-762 |
6319 | { | - |
6320 | register unsigned int flags = extra_data->flags; executed (the execution status of this line is deduced): register unsigned int flags = extra_data->flags; | - |
6321 | if ((flags & PCRE_EXTRA_STUDY_DATA) != 0) partially evaluated: (flags & 0x0001) != 0 yes Evaluation Count:32 | no Evaluation Count:0 |
| 0-32 |
6322 | study = (const pcre_study_data *)extra_data->study_data; executed: study = (const pcre_study_data *)extra_data->study_data; Execution Count:32 | 32 |
6323 | if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) partially evaluated: (flags & 0x0002) != 0 no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
6324 | md->match_limit = extra_data->match_limit; never executed: md->match_limit = extra_data->match_limit; | 0 |
6325 | if ((flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) != 0) partially evaluated: (flags & 0x0010) != 0 no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
6326 | md->match_limit_recursion = extra_data->match_limit_recursion; never executed: md->match_limit_recursion = extra_data->match_limit_recursion; | 0 |
6327 | if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0) partially evaluated: (flags & 0x0004) != 0 no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
6328 | md->callout_data = extra_data->callout_data; never executed: md->callout_data = extra_data->callout_data; | 0 |
6329 | if ((flags & PCRE_EXTRA_TABLES) != 0) tables = extra_data->tables; never executed: tables = extra_data->tables; partially evaluated: (flags & 0x0008) != 0 no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
6330 | } executed: } Execution Count:32 | 32 |
6331 | | - |
6332 | /* If the exec call supplied NULL for tables, use the inbuilt ones. This | - |
6333 | is a feature that makes it possible to save compiled regex and re-use them | - |
6334 | in other programs later. */ | - |
6335 | | - |
6336 | if (tables == NULL) tables = PRIV(default_tables); executed: tables = _pcre16_default_tables; Execution Count:794 partially evaluated: tables == ((void *)0) yes Evaluation Count:794 | no Evaluation Count:0 |
| 0-794 |
6337 | | - |
6338 | /* Set up other data */ | - |
6339 | | - |
6340 | anchored = ((re->options | options) & PCRE_ANCHORED) != 0; executed (the execution status of this line is deduced): anchored = ((re->options | options) & 0x00000010) != 0; | - |
6341 | startline = (re->flags & PCRE_STARTLINE) != 0; executed (the execution status of this line is deduced): startline = (re->flags & 0x0100) != 0; | - |
6342 | firstline = (re->options & PCRE_FIRSTLINE) != 0; executed (the execution status of this line is deduced): firstline = (re->options & 0x00040000) != 0; | - |
6343 | | - |
6344 | /* The code starts after the real_pcre block and the capture name table. */ | - |
6345 | | - |
6346 | md->start_code = (const pcre_uchar *)re + re->name_table_offset + executed (the execution status of this line is deduced): md->start_code = (const pcre_uchar *)re + re->name_table_offset + | - |
6347 | re->name_count * re->name_entry_size; executed (the execution status of this line is deduced): re->name_count * re->name_entry_size; | - |
6348 | | - |
6349 | md->start_subject = (PCRE_PUCHAR)subject; executed (the execution status of this line is deduced): md->start_subject = (const pcre_uchar *)subject; | - |
6350 | md->start_offset = start_offset; executed (the execution status of this line is deduced): md->start_offset = start_offset; | - |
6351 | md->end_subject = md->start_subject + length; executed (the execution status of this line is deduced): md->end_subject = md->start_subject + length; | - |
6352 | end_subject = md->end_subject; executed (the execution status of this line is deduced): end_subject = md->end_subject; | - |
6353 | | - |
6354 | md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0; executed (the execution status of this line is deduced): md->endonly = (re->options & 0x00000020) != 0; | - |
6355 | md->use_ucp = (re->options & PCRE_UCP) != 0; executed (the execution status of this line is deduced): md->use_ucp = (re->options & 0x20000000) != 0; | - |
6356 | md->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0; executed (the execution status of this line is deduced): md->jscript_compat = (re->options & 0x02000000) != 0; | - |
6357 | md->ignore_skip_arg = FALSE; executed (the execution status of this line is deduced): md->ignore_skip_arg = 0; | - |
6358 | | - |
6359 | /* Some options are unpacked into BOOL variables in the hope that testing | - |
6360 | them will be faster than individual option bits. */ | - |
6361 | | - |
6362 | md->notbol = (options & PCRE_NOTBOL) != 0; executed (the execution status of this line is deduced): md->notbol = (options & 0x00000080) != 0; | - |
6363 | md->noteol = (options & PCRE_NOTEOL) != 0; executed (the execution status of this line is deduced): md->noteol = (options & 0x00000100) != 0; | - |
6364 | md->notempty = (options & PCRE_NOTEMPTY) != 0; executed (the execution status of this line is deduced): md->notempty = (options & 0x00000400) != 0; | - |
6365 | md->notempty_atstart = (options & PCRE_NOTEMPTY_ATSTART) != 0; executed (the execution status of this line is deduced): md->notempty_atstart = (options & 0x10000000) != 0; | - |
6366 | | - |
6367 | md->hitend = FALSE; executed (the execution status of this line is deduced): md->hitend = 0; | - |
6368 | md->mark = md->nomatch_mark = NULL; /* In case never set */ executed (the execution status of this line is deduced): md->mark = md->nomatch_mark = ((void *)0); | - |
6369 | | - |
6370 | md->recursive = NULL; /* No recursion at top level */ executed (the execution status of this line is deduced): md->recursive = ((void *)0); | - |
6371 | md->hasthen = (re->flags & PCRE_HASTHEN) != 0; executed (the execution status of this line is deduced): md->hasthen = (re->flags & 0x1000) != 0; | - |
6372 | | - |
6373 | md->lcc = tables + lcc_offset; executed (the execution status of this line is deduced): md->lcc = tables + 0; | - |
6374 | md->fcc = tables + fcc_offset; executed (the execution status of this line is deduced): md->fcc = tables + 256; | - |
6375 | md->ctypes = tables + ctypes_offset; executed (the execution status of this line is deduced): md->ctypes = tables + (512 + 320); | - |
6376 | | - |
6377 | /* Handle different \R options. */ | - |
6378 | | - |
6379 | switch (options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) | - |
6380 | { | - |
6381 | case 0: | - |
6382 | if ((re->options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) != 0) partially evaluated: (re->options & (0x00800000|0x01000000)) != 0 no Evaluation Count:0 | yes Evaluation Count:794 |
| 0-794 |
6383 | md->bsr_anycrlf = (re->options & PCRE_BSR_ANYCRLF) != 0; never executed: md->bsr_anycrlf = (re->options & 0x00800000) != 0; | 0 |
6384 | else | - |
6385 | #ifdef BSR_ANYCRLF | - |
6386 | md->bsr_anycrlf = TRUE; | - |
6387 | #else | - |
6388 | md->bsr_anycrlf = FALSE; executed: md->bsr_anycrlf = 0; Execution Count:794 | 794 |
6389 | #endif | - |
6390 | break; executed: break; Execution Count:794 | 794 |
6391 | | - |
6392 | case PCRE_BSR_ANYCRLF: | - |
6393 | md->bsr_anycrlf = TRUE; never executed (the execution status of this line is deduced): md->bsr_anycrlf = 1; | - |
6394 | break; | 0 |
6395 | | - |
6396 | case PCRE_BSR_UNICODE: | - |
6397 | md->bsr_anycrlf = FALSE; never executed (the execution status of this line is deduced): md->bsr_anycrlf = 0; | - |
6398 | break; | 0 |
6399 | | - |
6400 | default: return PCRE_ERROR_BADNEWLINE; never executed: return (-23); | 0 |
6401 | } | - |
6402 | | - |
6403 | /* Handle different types of newline. The three bits give eight cases. If | - |
6404 | nothing is set at run time, whatever was used at compile time applies. */ | - |
6405 | | - |
6406 | switch ((((options & PCRE_NEWLINE_BITS) == 0)? re->options : | - |
6407 | (pcre_uint32)options) & PCRE_NEWLINE_BITS) | - |
6408 | { | - |
6409 | case 0: newline = NEWLINE; break; /* Compile-time default */ executed: break; Execution Count:748 | 748 |
6410 | case PCRE_NEWLINE_CR: newline = CHAR_CR; break; | 0 |
6411 | case PCRE_NEWLINE_LF: newline = CHAR_NL; break; | 0 |
6412 | case PCRE_NEWLINE_CR+ | - |
6413 | PCRE_NEWLINE_LF: newline = (CHAR_CR << 8) | CHAR_NL; break; executed: break; Execution Count:30 | 30 |
6414 | case PCRE_NEWLINE_ANY: newline = -1; break; | 0 |
6415 | case PCRE_NEWLINE_ANYCRLF: newline = -2; break; executed: break; Execution Count:16 | 16 |
6416 | default: return PCRE_ERROR_BADNEWLINE; never executed: return (-23); | 0 |
6417 | } | - |
6418 | | - |
6419 | if (newline == -2) evaluated: newline == -2 yes Evaluation Count:16 | yes Evaluation Count:778 |
| 16-778 |
6420 | { | - |
6421 | md->nltype = NLTYPE_ANYCRLF; executed (the execution status of this line is deduced): md->nltype = 2; | - |
6422 | } executed: } Execution Count:16 | 16 |
6423 | else if (newline < 0) partially evaluated: newline < 0 no Evaluation Count:0 | yes Evaluation Count:778 |
| 0-778 |
6424 | { | - |
6425 | md->nltype = NLTYPE_ANY; never executed (the execution status of this line is deduced): md->nltype = 1; | - |
6426 | } | 0 |
6427 | else | - |
6428 | { | - |
6429 | md->nltype = NLTYPE_FIXED; executed (the execution status of this line is deduced): md->nltype = 0; | - |
6430 | if (newline > 255) evaluated: newline > 255 yes Evaluation Count:30 | yes Evaluation Count:748 |
| 30-748 |
6431 | { | - |
6432 | md->nllen = 2; executed (the execution status of this line is deduced): md->nllen = 2; | - |
6433 | md->nl[0] = (newline >> 8) & 255; executed (the execution status of this line is deduced): md->nl[0] = (newline >> 8) & 255; | - |
6434 | md->nl[1] = newline & 255; executed (the execution status of this line is deduced): md->nl[1] = newline & 255; | - |
6435 | } executed: } Execution Count:30 | 30 |
6436 | else | - |
6437 | { | - |
6438 | md->nllen = 1; executed (the execution status of this line is deduced): md->nllen = 1; | - |
6439 | md->nl[0] = newline; executed (the execution status of this line is deduced): md->nl[0] = newline; | - |
6440 | } executed: } Execution Count:748 | 748 |
6441 | } | - |
6442 | | - |
6443 | /* Partial matching was originally supported only for a restricted set of | - |
6444 | regexes; from release 8.00 there are no restrictions, but the bits are still | - |
6445 | defined (though never set). So there's no harm in leaving this code. */ | - |
6446 | | - |
6447 | if (md->partial && (re->flags & PCRE_NOPARTIAL) != 0) evaluated: md->partial yes Evaluation Count:23 | yes Evaluation Count:771 |
partially evaluated: (re->flags & 0x0200) != 0 no Evaluation Count:0 | yes Evaluation Count:23 |
| 0-771 |
6448 | return PCRE_ERROR_BADPARTIAL; never executed: return (-13); | 0 |
6449 | | - |
6450 | /* If the expression has got more back references than the offsets supplied can | - |
6451 | hold, we get a temporary chunk of working store to use during the matching. | - |
6452 | Otherwise, we can use the vector supplied, rounding down its size to a multiple | - |
6453 | of 3. */ | - |
6454 | | - |
6455 | ocount = offsetcount - (offsetcount % 3); executed (the execution status of this line is deduced): ocount = offsetcount - (offsetcount % 3); | - |
6456 | arg_offset_max = (2*ocount)/3; executed (the execution status of this line is deduced): arg_offset_max = (2*ocount)/3; | - |
6457 | | - |
6458 | if (re->top_backref > 0 && re->top_backref >= ocount/3) partially evaluated: re->top_backref > 0 no Evaluation Count:0 | yes Evaluation Count:794 |
never evaluated: re->top_backref >= ocount/3 | 0-794 |
6459 | { | - |
6460 | ocount = re->top_backref * 3 + 3; never executed (the execution status of this line is deduced): ocount = re->top_backref * 3 + 3; | - |
6461 | md->offset_vector = (int *)(PUBL(malloc))(ocount * sizeof(int)); never executed (the execution status of this line is deduced): md->offset_vector = (int *)(pcre16_malloc)(ocount * sizeof(int)); | - |
6462 | if (md->offset_vector == NULL) return PCRE_ERROR_NOMEMORY; never executed: return (-6); never evaluated: md->offset_vector == ((void *)0) | 0 |
6463 | using_temporary_offsets = TRUE; never executed (the execution status of this line is deduced): using_temporary_offsets = 1; | - |
6464 | DPRINTF(("Got memory to hold back references\n")); | - |
6465 | } | 0 |
6466 | else md->offset_vector = offsets; executed: md->offset_vector = offsets; Execution Count:794 | 794 |
6467 | | - |
6468 | md->offset_end = ocount; executed (the execution status of this line is deduced): md->offset_end = ocount; | - |
6469 | md->offset_max = (2*ocount)/3; executed (the execution status of this line is deduced): md->offset_max = (2*ocount)/3; | - |
6470 | md->offset_overflow = FALSE; executed (the execution status of this line is deduced): md->offset_overflow = 0; | - |
6471 | md->capture_last = -1; executed (the execution status of this line is deduced): md->capture_last = -1; | - |
6472 | | - |
6473 | /* Reset the working variable associated with each extraction. These should | - |
6474 | never be used unless previously set, but they get saved and restored, and so we | - |
6475 | initialize them to avoid reading uninitialized locations. Also, unset the | - |
6476 | offsets for the matched string. This is really just for tidiness with callouts, | - |
6477 | in case they inspect these fields. */ | - |
6478 | | - |
6479 | if (md->offset_vector != NULL) partially evaluated: md->offset_vector != ((void *)0) yes Evaluation Count:794 | no Evaluation Count:0 |
| 0-794 |
6480 | { | - |
6481 | register int *iptr = md->offset_vector + ocount; executed (the execution status of this line is deduced): register int *iptr = md->offset_vector + ocount; | - |
6482 | register int *iend = iptr - re->top_bracket; executed (the execution status of this line is deduced): register int *iend = iptr - re->top_bracket; | - |
6483 | if (iend < md->offset_vector + 2) iend = md->offset_vector + 2; never executed: iend = md->offset_vector + 2; partially evaluated: iend < md->offset_vector + 2 no Evaluation Count:0 | yes Evaluation Count:794 |
| 0-794 |
6484 | while (--iptr >= iend) *iptr = -1; executed: *iptr = -1; Execution Count:223 evaluated: --iptr >= iend yes Evaluation Count:223 | yes Evaluation Count:794 |
| 223-794 |
6485 | md->offset_vector[0] = md->offset_vector[1] = -1; executed (the execution status of this line is deduced): md->offset_vector[0] = md->offset_vector[1] = -1; | - |
6486 | } executed: } Execution Count:794 | 794 |
6487 | | - |
6488 | /* Set up the first character to match, if available. The first_char value is | - |
6489 | never set for an anchored regular expression, but the anchoring may be forced | - |
6490 | at run time, so we have to test for anchoring. The first char may be unset for | - |
6491 | an unanchored pattern, of course. If there's no first char and the pattern was | - |
6492 | studied, there may be a bitmap of possible first characters. */ | - |
6493 | | - |
6494 | if (!anchored) evaluated: !anchored yes Evaluation Count:613 | yes Evaluation Count:181 |
| 181-613 |
6495 | { | - |
6496 | if ((re->flags & PCRE_FIRSTSET) != 0) evaluated: (re->flags & 0x0010) != 0 yes Evaluation Count:379 | yes Evaluation Count:234 |
| 234-379 |
6497 | { | - |
6498 | has_first_char = TRUE; executed (the execution status of this line is deduced): has_first_char = 1; | - |
6499 | first_char = first_char2 = (pcre_uchar)(re->first_char); executed (the execution status of this line is deduced): first_char = first_char2 = (pcre_uchar)(re->first_char); | - |
6500 | if ((re->flags & PCRE_FCH_CASELESS) != 0) evaluated: (re->flags & 0x0020) != 0 yes Evaluation Count:52 | yes Evaluation Count:327 |
| 52-327 |
6501 | { | - |
6502 | first_char2 = TABLE_GET(first_char, md->fcc, first_char); evaluated: ((first_char) <= 255u) yes Evaluation Count:51 | yes Evaluation Count:1 |
| 1-51 |
6503 | #if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) | - |
6504 | if (utf && first_char > 127) partially evaluated: utf yes Evaluation Count:52 | no Evaluation Count:0 |
evaluated: first_char > 127 yes Evaluation Count:1 | yes Evaluation Count:51 |
| 0-52 |
6505 | first_char2 = UCD_OTHERCASE(first_char); executed: first_char2 = (first_char + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(first_char) / 128] * 128 + (first_char) % 128])->other_case); Execution Count:1 | 1 |
6506 | #endif | - |
6507 | } executed: } Execution Count:52 | 52 |
6508 | } executed: } Execution Count:379 | 379 |
6509 | else | - |
6510 | if (!startline && study != NULL && evaluated: !startline yes Evaluation Count:187 | yes Evaluation Count:47 |
partially evaluated: study != ((void *)0) no Evaluation Count:0 | yes Evaluation Count:187 |
| 0-187 |
6511 | (study->flags & PCRE_STUDY_MAPPED) != 0) never evaluated: (study->flags & 0x0001) != 0 | 0 |
6512 | start_bits = study->start_bits; never executed: start_bits = study->start_bits; | 0 |
6513 | } | - |
6514 | | - |
6515 | /* For anchored or unanchored matches, there may be a "last known required | - |
6516 | character" set. */ | - |
6517 | | - |
6518 | if ((re->flags & PCRE_REQCHSET) != 0) evaluated: (re->flags & 0x0040) != 0 yes Evaluation Count:159 | yes Evaluation Count:635 |
| 159-635 |
6519 | { | - |
6520 | has_req_char = TRUE; executed (the execution status of this line is deduced): has_req_char = 1; | - |
6521 | req_char = req_char2 = (pcre_uchar)(re->req_char); executed (the execution status of this line is deduced): req_char = req_char2 = (pcre_uchar)(re->req_char); | - |
6522 | if ((re->flags & PCRE_RCH_CASELESS) != 0) evaluated: (re->flags & 0x0080) != 0 yes Evaluation Count:33 | yes Evaluation Count:126 |
| 33-126 |
6523 | { | - |
6524 | req_char2 = TABLE_GET(req_char, md->fcc, req_char); evaluated: ((req_char) <= 255u) yes Evaluation Count:32 | yes Evaluation Count:1 |
| 1-32 |
6525 | #if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) | - |
6526 | if (utf && req_char > 127) partially evaluated: utf yes Evaluation Count:33 | no Evaluation Count:0 |
evaluated: req_char > 127 yes Evaluation Count:2 | yes Evaluation Count:31 |
| 0-33 |
6527 | req_char2 = UCD_OTHERCASE(req_char); executed: req_char2 = (req_char + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(req_char) / 128] * 128 + (req_char) % 128])->other_case); Execution Count:2 | 2 |
6528 | #endif | - |
6529 | } executed: } Execution Count:33 | 33 |
6530 | } executed: } Execution Count:159 | 159 |
6531 | | - |
6532 | | - |
6533 | /* ==========================================================================*/ | - |
6534 | | - |
6535 | /* Loop for handling unanchored repeated matching attempts; for anchored regexs | - |
6536 | the loop runs just once. */ | - |
6537 | | - |
6538 | for(;;) executed (the execution status of this line is deduced): for(;;) | - |
6539 | { | - |
6540 | PCRE_PUCHAR save_end_subject = end_subject; executed (the execution status of this line is deduced): const pcre_uchar * save_end_subject = end_subject; | - |
6541 | PCRE_PUCHAR new_start_match; executed (the execution status of this line is deduced): const pcre_uchar * new_start_match; | - |
6542 | | - |
6543 | /* If firstline is TRUE, the start of the match is constrained to the first | - |
6544 | line of a multiline string. That is, the match must be before or at the first | - |
6545 | newline. Implement this by temporarily adjusting end_subject so that we stop | - |
6546 | scanning at a newline. If the match fails at the newline, later code breaks | - |
6547 | this loop. */ | - |
6548 | | - |
6549 | if (firstline) partially evaluated: firstline no Evaluation Count:0 | yes Evaluation Count:1084 |
| 0-1084 |
6550 | { | - |
6551 | PCRE_PUCHAR t = start_match; never executed (the execution status of this line is deduced): const pcre_uchar * t = start_match; | - |
6552 | #ifdef SUPPORT_UTF | - |
6553 | if (utf) | 0 |
6554 | { | - |
6555 | while (t < md->end_subject && !IS_NEWLINE(t)) never evaluated: t < md->end_subject never evaluated: (md->nltype != 0) | 0 |
6556 | { | - |
6557 | t++; never executed (the execution status of this line is deduced): t++; | - |
6558 | ACROSSCHAR(t < end_subject, *t, t++); never executed: t++; never evaluated: (t < end_subject) never evaluated: ((*t) & 0xfc00) == 0xdc00 | 0 |
6559 | } | 0 |
6560 | } | 0 |
6561 | else | - |
6562 | #endif | - |
6563 | while (t < md->end_subject && !IS_NEWLINE(t)) t++; never executed: t++; never evaluated: t < md->end_subject never evaluated: (md->nltype != 0) | 0 |
6564 | end_subject = t; never executed (the execution status of this line is deduced): end_subject = t; | - |
6565 | } | 0 |
6566 | | - |
6567 | /* There are some optimizations that avoid running the match if a known | - |
6568 | starting point is not found, or if a known later character is not present. | - |
6569 | However, there is an option that disables these, for testing and for ensuring | - |
6570 | that all callouts do actually occur. The option can be set in the regex by | - |
6571 | (*NO_START_OPT) or passed in match-time options. */ | - |
6572 | | - |
6573 | if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0) partially evaluated: ((options | re->options) & 0x04000000) == 0 yes Evaluation Count:1084 | no Evaluation Count:0 |
| 0-1084 |
6574 | { | - |
6575 | /* Advance to a unique first char if there is one. */ | - |
6576 | | - |
6577 | if (has_first_char) evaluated: has_first_char yes Evaluation Count:397 | yes Evaluation Count:687 |
| 397-687 |
6578 | { | - |
6579 | if (first_char != first_char2) evaluated: first_char != first_char2 yes Evaluation Count:52 | yes Evaluation Count:345 |
| 52-345 |
6580 | while (start_match < end_subject && evaluated: start_match < end_subject yes Evaluation Count:96 | yes Evaluation Count:13 |
| 13-96 |
6581 | *start_match != first_char && *start_match != first_char2) evaluated: *start_match != first_char yes Evaluation Count:81 | yes Evaluation Count:15 |
evaluated: *start_match != first_char2 yes Evaluation Count:57 | yes Evaluation Count:24 |
| 15-81 |
6582 | start_match++; executed: start_match++; Execution Count:57 | 57 |
6583 | else | - |
6584 | while (start_match < end_subject && *start_match != first_char) evaluated: start_match < end_subject yes Evaluation Count:2419 | yes Evaluation Count:104 |
evaluated: *start_match != first_char yes Evaluation Count:2178 | yes Evaluation Count:241 |
| 104-2419 |
6585 | start_match++; executed: start_match++; Execution Count:2178 | 2178 |
6586 | } | - |
6587 | | - |
6588 | /* Or to just after a linebreak for a multiline match */ | - |
6589 | | - |
6590 | else if (startline) evaluated: startline yes Evaluation Count:85 | yes Evaluation Count:602 |
| 85-602 |
6591 | { | - |
6592 | if (start_match > md->start_subject + start_offset) evaluated: start_match > md->start_subject + start_offset yes Evaluation Count:2 | yes Evaluation Count:83 |
| 2-83 |
6593 | { | - |
6594 | #ifdef SUPPORT_UTF | - |
6595 | if (utf) partially evaluated: utf yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
6596 | { | - |
6597 | while (start_match < end_subject && !WAS_NEWLINE(start_match)) partially evaluated: start_match < end_subject yes Evaluation Count:17 | no Evaluation Count:0 |
partially evaluated: (md->nltype != 0) no Evaluation Count:0 | yes Evaluation Count:17 |
| 0-17 |
6598 | { | - |
6599 | start_match++; executed (the execution status of this line is deduced): start_match++; | - |
6600 | ACROSSCHAR(start_match < end_subject, *start_match, never executed: start_match++; partially evaluated: (start_match < end_subject) yes Evaluation Count:15 | no Evaluation Count:0 |
partially evaluated: ((*start_match) & 0xfc00) == 0xdc00 no Evaluation Count:0 | yes Evaluation Count:15 |
| 0-15 |
6601 | start_match++); | - |
6602 | } executed: } Execution Count:15 | 15 |
6603 | } executed: } Execution Count:2 | 2 |
6604 | else | - |
6605 | #endif | - |
6606 | while (start_match < end_subject && !WAS_NEWLINE(start_match)) never evaluated: start_match < end_subject never evaluated: (md->nltype != 0) | 0 |
6607 | start_match++; never executed: start_match++; | 0 |
6608 | | - |
6609 | /* If we have just passed a CR and the newline option is ANY or ANYCRLF, | - |
6610 | and we are now at a LF, advance the match position by one more character. | - |
6611 | */ | - |
6612 | | - |
6613 | if (start_match[-1] == CHAR_CR && partially evaluated: start_match[-1] == '\015' no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
6614 | (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) && never evaluated: md->nltype == 1 never evaluated: md->nltype == 2 | 0 |
6615 | start_match < end_subject && never evaluated: start_match < end_subject | 0 |
6616 | *start_match == CHAR_NL) never evaluated: *start_match == '\012' | 0 |
6617 | start_match++; never executed: start_match++; | 0 |
6618 | } executed: } Execution Count:2 | 2 |
6619 | } executed: } Execution Count:85 | 85 |
6620 | | - |
6621 | /* Or to a non-unique first byte after study */ | - |
6622 | | - |
6623 | else if (start_bits != NULL) partially evaluated: start_bits != ((void *)0) no Evaluation Count:0 | yes Evaluation Count:602 |
| 0-602 |
6624 | { | - |
6625 | while (start_match < end_subject) never evaluated: start_match < end_subject | 0 |
6626 | { | - |
6627 | register unsigned int c = *start_match; never executed (the execution status of this line is deduced): register unsigned int c = *start_match; | - |
6628 | #ifndef COMPILE_PCRE8 | - |
6629 | if (c > 255) c = 255; never executed: c = 255; never evaluated: c > 255 | 0 |
6630 | #endif | - |
6631 | if ((start_bits[c/8] & (1 << (c&7))) == 0) never evaluated: (start_bits[c/8] & (1 << (c&7))) == 0 | 0 |
6632 | { | - |
6633 | start_match++; never executed (the execution status of this line is deduced): start_match++; | - |
6634 | #if defined SUPPORT_UTF && defined COMPILE_PCRE8 | - |
6635 | /* In non 8-bit mode, the iteration will stop for | - |
6636 | characters > 255 at the beginning or not stop at all. */ | - |
6637 | if (utf) | - |
6638 | ACROSSCHAR(start_match < end_subject, *start_match, | - |
6639 | start_match++); | - |
6640 | #endif | - |
6641 | } | 0 |
6642 | else break; | 0 |
6643 | } | - |
6644 | } | 0 |
6645 | } /* Starting optimizations */ | - |
6646 | | - |
6647 | /* Restore fudged end_subject */ | - |
6648 | | - |
6649 | end_subject = save_end_subject; executed (the execution status of this line is deduced): end_subject = save_end_subject; | - |
6650 | | - |
6651 | /* The following two optimizations are disabled for partial matching or if | - |
6652 | disabling is explicitly requested. */ | - |
6653 | | - |
6654 | if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0 && !md->partial) partially evaluated: ((options | re->options) & 0x04000000) == 0 yes Evaluation Count:1084 | no Evaluation Count:0 |
evaluated: !md->partial yes Evaluation Count:1020 | yes Evaluation Count:64 |
| 0-1084 |
6655 | { | - |
6656 | /* If the pattern was studied, a minimum subject length may be set. This is | - |
6657 | a lower bound; no actual string of that length may actually match the | - |
6658 | pattern. Although the value is, strictly, in characters, we treat it as | - |
6659 | bytes to avoid spending too much time in this optimization. */ | - |
6660 | | - |
6661 | if (study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0 && evaluated: study != ((void *)0) yes Evaluation Count:32 | yes Evaluation Count:988 |
partially evaluated: (study->flags & 0x0002) != 0 no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-988 |
6662 | (pcre_uint32)(end_subject - start_match) < study->minlength) never evaluated: (pcre_uint32)(end_subject - start_match) < study->minlength | 0 |
6663 | { | - |
6664 | rc = MATCH_NOMATCH; never executed (the execution status of this line is deduced): rc = 0; | - |
6665 | break; | 0 |
6666 | } | - |
6667 | | - |
6668 | /* If req_char is set, we know that that character must appear in the | - |
6669 | subject for the match to succeed. If the first character is set, req_char | - |
6670 | must be later in the subject; otherwise the test starts at the match point. | - |
6671 | This optimization can save a huge amount of backtracking in patterns with | - |
6672 | nested unlimited repeats that aren't going to match. Writing separate code | - |
6673 | for cased/caseless versions makes it go faster, as does using an | - |
6674 | autoincrement and backing off on a match. | - |
6675 | | - |
6676 | HOWEVER: when the subject string is very, very long, searching to its end | - |
6677 | can take a long time, and give bad performance on quite ordinary patterns. | - |
6678 | This showed up when somebody was matching something like /^\d+C/ on a | - |
6679 | 32-megabyte string... so we don't do this when the string is sufficiently | - |
6680 | long. */ | - |
6681 | | - |
6682 | if (has_req_char && end_subject - start_match < REQ_BYTE_MAX) evaluated: has_req_char yes Evaluation Count:154 | yes Evaluation Count:866 |
partially evaluated: end_subject - start_match < 1000 yes Evaluation Count:154 | no Evaluation Count:0 |
| 0-866 |
6683 | { | - |
6684 | register PCRE_PUCHAR p = start_match + (has_first_char? 1:0); evaluated: has_first_char yes Evaluation Count:91 | yes Evaluation Count:63 |
| 63-91 |
6685 | | - |
6686 | /* We don't need to repeat the search if we haven't yet reached the | - |
6687 | place we found it at last time. */ | - |
6688 | | - |
6689 | if (p > req_char_ptr) evaluated: p > req_char_ptr yes Evaluation Count:152 | yes Evaluation Count:2 |
| 2-152 |
6690 | { | - |
6691 | if (req_char != req_char2) evaluated: req_char != req_char2 yes Evaluation Count:33 | yes Evaluation Count:119 |
| 33-119 |
6692 | { | - |
6693 | while (p < end_subject) evaluated: p < end_subject yes Evaluation Count:543 | yes Evaluation Count:8 |
| 8-543 |
6694 | { | - |
6695 | register int pp = *p++; executed (the execution status of this line is deduced): register int pp = *p++; | - |
6696 | if (pp == req_char || pp == req_char2) { p--; break; } executed: break; Execution Count:25 evaluated: pp == req_char yes Evaluation Count:9 | yes Evaluation Count:534 |
evaluated: pp == req_char2 yes Evaluation Count:16 | yes Evaluation Count:518 |
| 9-534 |
6697 | } executed: } Execution Count:518 | 518 |
6698 | } executed: } Execution Count:33 | 33 |
6699 | else | - |
6700 | { | - |
6701 | while (p < end_subject) evaluated: p < end_subject yes Evaluation Count:2300 | yes Evaluation Count:51 |
| 51-2300 |
6702 | { | - |
6703 | if (*p++ == req_char) { p--; break; } executed: break; Execution Count:68 evaluated: *p++ == req_char yes Evaluation Count:68 | yes Evaluation Count:2232 |
| 68-2232 |
6704 | } executed: } Execution Count:2232 | 2232 |
6705 | } executed: } Execution Count:119 | 119 |
6706 | | - |
6707 | /* If we can't find the required character, break the matching loop, | - |
6708 | forcing a match failure. */ | - |
6709 | | - |
6710 | if (p >= end_subject) evaluated: p >= end_subject yes Evaluation Count:59 | yes Evaluation Count:93 |
| 59-93 |
6711 | { | - |
6712 | rc = MATCH_NOMATCH; executed (the execution status of this line is deduced): rc = 0; | - |
6713 | break; executed: break; Execution Count:59 | 59 |
6714 | } | - |
6715 | | - |
6716 | /* If we have found the required character, save the point where we | - |
6717 | found it, so that we don't search again next time round the loop if | - |
6718 | the start hasn't passed this character yet. */ | - |
6719 | | - |
6720 | req_char_ptr = p; executed (the execution status of this line is deduced): req_char_ptr = p; | - |
6721 | } executed: } Execution Count:93 | 93 |
6722 | } executed: } Execution Count:95 | 95 |
6723 | } executed: } Execution Count:961 | 961 |
6724 | | - |
6725 | #ifdef PCRE_DEBUG /* Sigh. Some compilers never learn. */ | - |
6726 | printf(">>>> Match against: "); | - |
6727 | pchars(start_match, end_subject - start_match, TRUE, md); | - |
6728 | printf("\n"); | - |
6729 | #endif | - |
6730 | | - |
6731 | /* OK, we can now run the match. If "hitend" is set afterwards, remember the | - |
6732 | first starting point for which a partial match was found. */ | - |
6733 | | - |
6734 | md->start_match_ptr = start_match; executed (the execution status of this line is deduced): md->start_match_ptr = start_match; | - |
6735 | md->start_used_ptr = start_match; executed (the execution status of this line is deduced): md->start_used_ptr = start_match; | - |
6736 | md->match_call_count = 0; executed (the execution status of this line is deduced): md->match_call_count = 0; | - |
6737 | md->match_function_type = 0; executed (the execution status of this line is deduced): md->match_function_type = 0; | - |
6738 | md->end_offset_top = 0; executed (the execution status of this line is deduced): md->end_offset_top = 0; | - |
6739 | rc = match(start_match, md->start_code, start_match, 2, md, NULL, 0); executed (the execution status of this line is deduced): rc = match(start_match, md->start_code, start_match, 2, md, ((void *)0), 0); | - |
6740 | if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr; executed: start_partial = md->start_used_ptr; Execution Count:19 evaluated: md->hitend yes Evaluation Count:34 | yes Evaluation Count:991 |
evaluated: start_partial == ((void *)0) yes Evaluation Count:19 | yes Evaluation Count:15 |
| 15-991 |
6741 | | - |
6742 | switch(rc) | - |
6743 | { | - |
6744 | /* If MATCH_SKIP_ARG reaches this level it means that a MARK that matched | - |
6745 | the SKIP's arg was not found. In this circumstance, Perl ignores the SKIP | - |
6746 | entirely. The only way we can do that is to re-do the match at the same | - |
6747 | point, with a flag to force SKIP with an argument to be ignored. Just | - |
6748 | treating this case as NOMATCH does not work because it does not check other | - |
6749 | alternatives in patterns such as A(*SKIP:A)B|AC when the subject is AC. */ | - |
6750 | | - |
6751 | case MATCH_SKIP_ARG: | - |
6752 | new_start_match = start_match; never executed (the execution status of this line is deduced): new_start_match = start_match; | - |
6753 | md->ignore_skip_arg = TRUE; never executed (the execution status of this line is deduced): md->ignore_skip_arg = 1; | - |
6754 | break; | 0 |
6755 | | - |
6756 | /* SKIP passes back the next starting point explicitly, but if it is the | - |
6757 | same as the match we have just done, treat it as NOMATCH. */ | - |
6758 | | - |
6759 | case MATCH_SKIP: | - |
6760 | if (md->start_match_ptr != start_match) never evaluated: md->start_match_ptr != start_match | 0 |
6761 | { | - |
6762 | new_start_match = md->start_match_ptr; never executed (the execution status of this line is deduced): new_start_match = md->start_match_ptr; | - |
6763 | break; | 0 |
6764 | } | - |
6765 | /* Fall through */ | - |
6766 | | - |
6767 | /* NOMATCH and PRUNE advance by one character. THEN at this level acts | - |
6768 | exactly like PRUNE. Unset the ignore SKIP-with-argument flag. */ | - |
6769 | | - |
6770 | case MATCH_NOMATCH: code before this statement never executed: case 0: | 0 |
6771 | case MATCH_PRUNE: | - |
6772 | case MATCH_THEN: | - |
6773 | md->ignore_skip_arg = FALSE; executed (the execution status of this line is deduced): md->ignore_skip_arg = 0; | - |
6774 | new_start_match = start_match + 1; executed (the execution status of this line is deduced): new_start_match = start_match + 1; | - |
6775 | #ifdef SUPPORT_UTF | - |
6776 | if (utf) partially evaluated: utf yes Evaluation Count:530 | no Evaluation Count:0 |
| 0-530 |
6777 | ACROSSCHAR(new_start_match < end_subject, *new_start_match, executed: new_start_match++; Execution Count:6 evaluated: (new_start_match < end_subject) yes Evaluation Count:358 | yes Evaluation Count:172 |
evaluated: ((*new_start_match) & 0xfc00) == 0xdc00 yes Evaluation Count:6 | yes Evaluation Count:352 |
| 6-358 |
6778 | new_start_match++); | - |
6779 | #endif | - |
6780 | break; executed: break; Execution Count:530 | 530 |
6781 | | - |
6782 | /* COMMIT disables the bumpalong, but otherwise behaves as NOMATCH. */ | - |
6783 | | - |
6784 | case MATCH_COMMIT: | - |
6785 | rc = MATCH_NOMATCH; never executed (the execution status of this line is deduced): rc = 0; | - |
6786 | goto ENDLOOP; never executed: goto ENDLOOP; | 0 |
6787 | | - |
6788 | /* Any other return is either a match, or some kind of error. */ | - |
6789 | | - |
6790 | default: | - |
6791 | goto ENDLOOP; executed: goto ENDLOOP; Execution Count:495 | 495 |
6792 | } | - |
6793 | | - |
6794 | /* Control reaches here for the various types of "no match at this point" | - |
6795 | result. Reset the code to MATCH_NOMATCH for subsequent checking. */ | - |
6796 | | - |
6797 | rc = MATCH_NOMATCH; executed (the execution status of this line is deduced): rc = 0; | - |
6798 | | - |
6799 | /* If PCRE_FIRSTLINE is set, the match must happen before or at the first | - |
6800 | newline in the subject (though it may continue over the newline). Therefore, | - |
6801 | if we have just failed to match, starting at a newline, do not continue. */ | - |
6802 | | - |
6803 | if (firstline && IS_NEWLINE(start_match)) break; never executed: break; partially evaluated: firstline no Evaluation Count:0 | yes Evaluation Count:530 |
never evaluated: (md->nltype != 0) | 0-530 |
6804 | | - |
6805 | /* Advance to new matching position */ | - |
6806 | | - |
6807 | start_match = new_start_match; executed (the execution status of this line is deduced): start_match = new_start_match; | - |
6808 | | - |
6809 | /* Break the loop if the pattern is anchored or if we have passed the end of | - |
6810 | the subject. */ | - |
6811 | | - |
6812 | if (anchored || start_match > end_subject) break; executed: break; Execution Count:240 evaluated: anchored yes Evaluation Count:122 | yes Evaluation Count:408 |
evaluated: start_match > end_subject yes Evaluation Count:118 | yes Evaluation Count:290 |
| 118-408 |
6813 | | - |
6814 | /* If we have just passed a CR and we are now at a LF, and the pattern does | - |
6815 | not contain any explicit matches for \r or \n, and the newline option is CRLF | - |
6816 | or ANY or ANYCRLF, advance the match position by one more character. In | - |
6817 | normal matching start_match will aways be greater than the first position at | - |
6818 | this stage, but a failed *SKIP can cause a return at the same point, which is | - |
6819 | why the first test exists. */ | - |
6820 | | - |
6821 | if (start_match > (PCRE_PUCHAR)subject + start_offset && partially evaluated: start_match > (const pcre_uchar *)subject + start_offset yes Evaluation Count:290 | no Evaluation Count:0 |
| 0-290 |
6822 | start_match[-1] == CHAR_CR && partially evaluated: start_match[-1] == '\015' no Evaluation Count:0 | yes Evaluation Count:290 |
| 0-290 |
6823 | start_match < end_subject && never evaluated: start_match < end_subject | 0 |
6824 | *start_match == CHAR_NL && never evaluated: *start_match == '\012' | 0 |
6825 | (re->flags & PCRE_HASCRORLF) == 0 && never evaluated: (re->flags & 0x0800) == 0 | 0 |
6826 | (md->nltype == NLTYPE_ANY || never evaluated: md->nltype == 1 | 0 |
6827 | md->nltype == NLTYPE_ANYCRLF || never evaluated: md->nltype == 2 | 0 |
6828 | md->nllen == 2)) never evaluated: md->nllen == 2 | 0 |
6829 | start_match++; never executed: start_match++; | 0 |
6830 | | - |
6831 | md->mark = NULL; /* Reset for start of next match attempt */ executed (the execution status of this line is deduced): md->mark = ((void *)0); | - |
6832 | } /* End of for(;;) "bumpalong" loop */ executed: } Execution Count:290 | 290 |
6833 | | - |
6834 | /* ==========================================================================*/ | - |
6835 | | - |
6836 | /* We reach here when rc is not MATCH_NOMATCH, or if one of the stopping | - |
6837 | conditions is true: | - |
6838 | | - |
6839 | (1) The pattern is anchored or the match was failed by (*COMMIT); | - |
6840 | | - |
6841 | (2) We are past the end of the subject; | - |
6842 | | - |
6843 | (3) PCRE_FIRSTLINE is set and we have failed to match at a newline, because | - |
6844 | this option requests that a match occur at or before the first newline in | - |
6845 | the subject. | - |
6846 | | - |
6847 | When we have a match and the offset vector is big enough to deal with any | - |
6848 | backreferences, captured substring offsets will already be set up. In the case | - |
6849 | where we had to get some local store to hold offsets for backreference | - |
6850 | processing, copy those that we can. In this case there need not be overflow if | - |
6851 | certain parts of the pattern were not used, even though there are more | - |
6852 | capturing parentheses than vector slots. */ | - |
6853 | | - |
6854 | ENDLOOP: code before this statement executed: ENDLOOP: Execution Count:299 | 299 |
6855 | | - |
6856 | if (rc == MATCH_MATCH || rc == MATCH_ACCEPT) evaluated: rc == 1 yes Evaluation Count:480 | yes Evaluation Count:314 |
partially evaluated: rc == (-999) no Evaluation Count:0 | yes Evaluation Count:314 |
| 0-480 |
6857 | { | - |
6858 | if (using_temporary_offsets) partially evaluated: using_temporary_offsets no Evaluation Count:0 | yes Evaluation Count:480 |
| 0-480 |
6859 | { | - |
6860 | if (arg_offset_max >= 4) never evaluated: arg_offset_max >= 4 | 0 |
6861 | { | - |
6862 | memcpy(offsets + 2, md->offset_vector + 2, never executed (the execution status of this line is deduced): memcpy(offsets + 2, md->offset_vector + 2, | - |
6863 | (arg_offset_max - 2) * sizeof(int)); never executed (the execution status of this line is deduced): (arg_offset_max - 2) * sizeof(int)); | - |
6864 | DPRINTF(("Copied offsets from temporary memory\n")); | - |
6865 | } | 0 |
6866 | if (md->end_offset_top > arg_offset_max) md->offset_overflow = TRUE; never executed: md->offset_overflow = 1; never evaluated: md->end_offset_top > arg_offset_max | 0 |
6867 | DPRINTF(("Freeing temporary memory\n")); | - |
6868 | (PUBL(free))(md->offset_vector); never executed (the execution status of this line is deduced): (pcre16_free)(md->offset_vector); | - |
6869 | } | 0 |
6870 | | - |
6871 | /* Set the return code to the number of captured strings, or 0 if there were | - |
6872 | too many to fit into the vector. */ | - |
6873 | | - |
6874 | rc = (md->offset_overflow && md->end_offset_top >= arg_offset_max)? partially evaluated: md->offset_overflow no Evaluation Count:0 | yes Evaluation Count:480 |
never evaluated: md->end_offset_top >= arg_offset_max | 0-480 |
6875 | 0 : md->end_offset_top/2; executed (the execution status of this line is deduced): 0 : md->end_offset_top/2; | - |
6876 | | - |
6877 | /* If there is space in the offset vector, set any unused pairs at the end of | - |
6878 | the pattern to -1 for backwards compatibility. It is documented that this | - |
6879 | happens. In earlier versions, the whole set of potential capturing offsets | - |
6880 | was set to -1 each time round the loop, but this is handled differently now. | - |
6881 | "Gaps" are set to -1 dynamically instead (this fixes a bug). Thus, it is only | - |
6882 | those at the end that need unsetting here. We can't just unset them all at | - |
6883 | the start of the whole thing because they may get set in one branch that is | - |
6884 | not the final matching branch. */ | - |
6885 | | - |
6886 | if (md->end_offset_top/2 <= re->top_bracket && offsets != NULL) partially evaluated: md->end_offset_top/2 <= re->top_bracket no Evaluation Count:0 | yes Evaluation Count:480 |
never evaluated: offsets != ((void *)0) | 0-480 |
6887 | { | - |
6888 | register int *iptr, *iend; never executed (the execution status of this line is deduced): register int *iptr, *iend; | - |
6889 | int resetcount = 2 + re->top_bracket * 2; never executed (the execution status of this line is deduced): int resetcount = 2 + re->top_bracket * 2; | - |
6890 | if (resetcount > offsetcount) resetcount = ocount; never executed: resetcount = ocount; never evaluated: resetcount > offsetcount | 0 |
6891 | iptr = offsets + md->end_offset_top; never executed (the execution status of this line is deduced): iptr = offsets + md->end_offset_top; | - |
6892 | iend = offsets + resetcount; never executed (the execution status of this line is deduced): iend = offsets + resetcount; | - |
6893 | while (iptr < iend) *iptr++ = -1; never executed: *iptr++ = -1; never evaluated: iptr < iend | 0 |
6894 | } | 0 |
6895 | | - |
6896 | /* If there is space, set up the whole thing as substring 0. The value of | - |
6897 | md->start_match_ptr might be modified if \K was encountered on the success | - |
6898 | matching path. */ | - |
6899 | | - |
6900 | if (offsetcount < 2) rc = 0; else never executed: rc = 0; partially evaluated: offsetcount < 2 no Evaluation Count:0 | yes Evaluation Count:480 |
| 0-480 |
6901 | { | - |
6902 | offsets[0] = (int)(md->start_match_ptr - md->start_subject); executed (the execution status of this line is deduced): offsets[0] = (int)(md->start_match_ptr - md->start_subject); | - |
6903 | offsets[1] = (int)(md->end_match_ptr - md->start_subject); executed (the execution status of this line is deduced): offsets[1] = (int)(md->end_match_ptr - md->start_subject); | - |
6904 | } executed: } Execution Count:480 | 480 |
6905 | | - |
6906 | /* Return MARK data if requested */ | - |
6907 | | - |
6908 | if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0) evaluated: extra_data != ((void *)0) yes Evaluation Count:1 | yes Evaluation Count:479 |
partially evaluated: (extra_data->flags & 0x0020) != 0 no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-479 |
6909 | *(extra_data->mark) = (pcre_uchar *)md->mark; never executed: *(extra_data->mark) = (pcre_uchar *)md->mark; | 0 |
6910 | DPRINTF((">>>> returning %d\n", rc)); | - |
6911 | return rc; executed: return rc; Execution Count:480 | 480 |
6912 | } | - |
6913 | | - |
6914 | /* Control gets here if there has been an error, or if the overall match | - |
6915 | attempt has failed at all permitted starting positions. */ | - |
6916 | | - |
6917 | if (using_temporary_offsets) partially evaluated: using_temporary_offsets no Evaluation Count:0 | yes Evaluation Count:314 |
| 0-314 |
6918 | { | - |
6919 | DPRINTF(("Freeing temporary memory\n")); | - |
6920 | (PUBL(free))(md->offset_vector); never executed (the execution status of this line is deduced): (pcre16_free)(md->offset_vector); | - |
6921 | } | 0 |
6922 | | - |
6923 | /* For anything other than nomatch or partial match, just return the code. */ | - |
6924 | | - |
6925 | if (rc != MATCH_NOMATCH && rc != PCRE_ERROR_PARTIAL) evaluated: rc != 0 yes Evaluation Count:15 | yes Evaluation Count:299 |
evaluated: rc != (-12) yes Evaluation Count:4 | yes Evaluation Count:11 |
| 4-299 |
6926 | { | - |
6927 | DPRINTF((">>>> error: returning %d\n", rc)); | - |
6928 | return rc; executed: return rc; Execution Count:4 | 4 |
6929 | } | - |
6930 | | - |
6931 | /* Handle partial matches - disable any mark data */ | - |
6932 | | - |
6933 | if (start_partial != NULL) evaluated: start_partial != ((void *)0) yes Evaluation Count:17 | yes Evaluation Count:293 |
| 17-293 |
6934 | { | - |
6935 | DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n")); | - |
6936 | md->mark = NULL; executed (the execution status of this line is deduced): md->mark = ((void *)0); | - |
6937 | if (offsetcount > 1) partially evaluated: offsetcount > 1 yes Evaluation Count:17 | no Evaluation Count:0 |
| 0-17 |
6938 | { | - |
6939 | offsets[0] = (int)(start_partial - (PCRE_PUCHAR)subject); executed (the execution status of this line is deduced): offsets[0] = (int)(start_partial - (const pcre_uchar *)subject); | - |
6940 | offsets[1] = (int)(end_subject - (PCRE_PUCHAR)subject); executed (the execution status of this line is deduced): offsets[1] = (int)(end_subject - (const pcre_uchar *)subject); | - |
6941 | } executed: } Execution Count:17 | 17 |
6942 | rc = PCRE_ERROR_PARTIAL; executed (the execution status of this line is deduced): rc = (-12); | - |
6943 | } executed: } Execution Count:17 | 17 |
6944 | | - |
6945 | /* This is the classic nomatch case */ | - |
6946 | | - |
6947 | else | - |
6948 | { | - |
6949 | DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n")); | - |
6950 | rc = PCRE_ERROR_NOMATCH; executed (the execution status of this line is deduced): rc = (-1); | - |
6951 | } executed: } Execution Count:293 | 293 |
6952 | | - |
6953 | /* Return the MARK data if it has been requested. */ | - |
6954 | | - |
6955 | if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0) evaluated: extra_data != ((void *)0) yes Evaluation Count:31 | yes Evaluation Count:279 |
partially evaluated: (extra_data->flags & 0x0020) != 0 no Evaluation Count:0 | yes Evaluation Count:31 |
| 0-279 |
6956 | *(extra_data->mark) = (pcre_uchar *)md->nomatch_mark; never executed: *(extra_data->mark) = (pcre_uchar *)md->nomatch_mark; | 0 |
6957 | return rc; executed: return rc; Execution Count:310 | 310 |
6958 | } | - |
6959 | | - |
6960 | /* End of pcre_exec.c */ | - |
6961 | | - |
| | |