../3rdparty/pcre/pcre_dfa_exec.c

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/************************************************* -
2* Perl-Compatible Regular Expressions * -
3*************************************************/ -
4 -
5/* PCRE is a library of functions to support regular expressions whose syntax -
6and semantics are as close as possible to those of the Perl 5 language (but see -
7below for why this module is different). -
8 -
9 Written by Philip Hazel -
10 Copyright (c) 1997-2012 University of Cambridge -
11 -
12----------------------------------------------------------------------------- -
13Redistribution and use in source and binary forms, with or without -
14modification, are permitted provided that the following conditions are met: -
15 -
16 * Redistributions of source code must retain the above copyright notice, -
17 this list of conditions and the following disclaimer. -
18 -
19 * Redistributions in binary form must reproduce the above copyright -
20 notice, this list of conditions and the following disclaimer in the -
21 documentation and/or other materials provided with the distribution. -
22 -
23 * Neither the name of the University of Cambridge nor the names of its -
24 contributors may be used to endorse or promote products derived from -
25 this software without specific prior written permission. -
26 -
27THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -
28AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -
29IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -
30ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -
31LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -
32CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -
33SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -
34INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -
35CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -
36ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -
37POSSIBILITY OF SUCH DAMAGE. -
38----------------------------------------------------------------------------- -
39*/ -
40 -
41 -
42/* This module contains the external function pcre_dfa_exec(), which is an -
43alternative matching function that uses a sort of DFA algorithm (not a true -
44FSM). This is NOT Perl- compatible, but it has advantages in certain -
45applications. */ -
46 -
47 -
48/* NOTE ABOUT PERFORMANCE: A user of this function sent some code that improved -
49the performance of his patterns greatly. I could not use it as it stood, as it -
50was not thread safe, and made assumptions about pattern sizes. Also, it caused -
51test 7 to loop, and test 9 to crash with a segfault. -
52 -
53The issue is the check for duplicate states, which is done by a simple linear -
54search up the state list. (Grep for "duplicate" below to find the code.) For -
55many patterns, there will never be many states active at one time, so a simple -
56linear search is fine. In patterns that have many active states, it might be a -
57bottleneck. The suggested code used an indexing scheme to remember which states -
58had previously been used for each character, and avoided the linear search when -
59it knew there was no chance of a duplicate. This was implemented when adding -
60states to the state lists. -
61 -
62I wrote some thread-safe, not-limited code to try something similar at the time -
63of checking for duplicates (instead of when adding states), using index vectors -
64on the stack. It did give a 13% improvement with one specially constructed -
65pattern for certain subject strings, but on other strings and on many of the -
66simpler patterns in the test suite it did worse. The major problem, I think, -
67was the extra time to initialize the index. This had to be done for each call -
68of internal_dfa_exec(). (The supplied patch used a static vector, initialized -
69only once - I suspect this was the cause of the problems with the tests.) -
70 -
71Overall, I concluded that the gains in some cases did not outweigh the losses -
72in others, so I abandoned this code. */ -
73 -
74 -
75 -
76#ifdef PCRE_HAVE_CONFIG_H -
77#include "config.h" -
78#endif -
79 -
80#define NLBLOCK md /* Block containing newline information */ -
81#define PSSTART start_subject /* Field containing processed string start */ -
82#define PSEND end_subject /* Field containing processed string end */ -
83 -
84#include "pcre_internal.h" -
85 -
86 -
87/* For use to indent debugging output */ -
88 -
89#define SP " " -
90 -
91 -
92/************************************************* -
93* Code parameters and static tables * -
94*************************************************/ -
95 -
96/* These are offsets that are used to turn the OP_TYPESTAR and friends opcodes -
97into others, under special conditions. A gap of 20 between the blocks should be -
98enough. The resulting opcodes don't have to be less than 256 because they are -
99never stored, so we push them well clear of the normal opcodes. */ -
100 -
101#define OP_PROP_EXTRA 300 -
102#define OP_EXTUNI_EXTRA 320 -
103#define OP_ANYNL_EXTRA 340 -
104#define OP_HSPACE_EXTRA 360 -
105#define OP_VSPACE_EXTRA 380 -
106 -
107 -
108/* This table identifies those opcodes that are followed immediately by a -
109character that is to be tested in some way. This makes it possible to -
110centralize the loading of these characters. In the case of Type * etc, the -
111"character" is the opcode for \D, \d, \S, \s, \W, or \w, which will always be a -
112small value. Non-zero values in the table are the offsets from the opcode where -
113the character is to be found. ***NOTE*** If the start of this table is -
114modified, the three tables that follow must also be modified. */ -
115 -
116static const pcre_uint8 coptable[] = { -
117 0, /* End */ -
118 0, 0, 0, 0, 0, /* \A, \G, \K, \B, \b */ -
119 0, 0, 0, 0, 0, 0, /* \D, \d, \S, \s, \W, \w */ -
120 0, 0, 0, /* Any, AllAny, Anybyte */ -
121 0, 0, /* \P, \p */ -
122 0, 0, 0, 0, 0, /* \R, \H, \h, \V, \v */ -
123 0, /* \X */ -
124 0, 0, 0, 0, 0, 0, /* \Z, \z, ^, ^M, $, $M */ -
125 1, /* Char */ -
126 1, /* Chari */ -
127 1, /* not */ -
128 1, /* noti */ -
129 /* Positive single-char repeats */ -
130 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ -
131 1+IMM2_SIZE, 1+IMM2_SIZE, /* upto, minupto */ -
132 1+IMM2_SIZE, /* exact */ -
133 1, 1, 1, 1+IMM2_SIZE, /* *+, ++, ?+, upto+ */ -
134 1, 1, 1, 1, 1, 1, /* *I, *?I, +I, +?I, ?I, ??I */ -
135 1+IMM2_SIZE, 1+IMM2_SIZE, /* upto I, minupto I */ -
136 1+IMM2_SIZE, /* exact I */ -
137 1, 1, 1, 1+IMM2_SIZE, /* *+I, ++I, ?+I, upto+I */ -
138 /* Negative single-char repeats - only for chars < 256 */ -
139 1, 1, 1, 1, 1, 1, /* NOT *, *?, +, +?, ?, ?? */ -
140 1+IMM2_SIZE, 1+IMM2_SIZE, /* NOT upto, minupto */ -
141 1+IMM2_SIZE, /* NOT exact */ -
142 1, 1, 1, 1+IMM2_SIZE, /* NOT *+, ++, ?+, upto+ */ -
143 1, 1, 1, 1, 1, 1, /* NOT *I, *?I, +I, +?I, ?I, ??I */ -
144 1+IMM2_SIZE, 1+IMM2_SIZE, /* NOT upto I, minupto I */ -
145 1+IMM2_SIZE, /* NOT exact I */ -
146 1, 1, 1, 1+IMM2_SIZE, /* NOT *+I, ++I, ?+I, upto+I */ -
147 /* Positive type repeats */ -
148 1, 1, 1, 1, 1, 1, /* Type *, *?, +, +?, ?, ?? */ -
149 1+IMM2_SIZE, 1+IMM2_SIZE, /* Type upto, minupto */ -
150 1+IMM2_SIZE, /* Type exact */ -
151 1, 1, 1, 1+IMM2_SIZE, /* Type *+, ++, ?+, upto+ */ -
152 /* Character class & ref repeats */ -
153 0, 0, 0, 0, 0, 0, /* *, *?, +, +?, ?, ?? */ -
154 0, 0, /* CRRANGE, CRMINRANGE */ -
155 0, /* CLASS */ -
156 0, /* NCLASS */ -
157 0, /* XCLASS - variable length */ -
158 0, /* REF */ -
159 0, /* REFI */ -
160 0, /* RECURSE */ -
161 0, /* CALLOUT */ -
162 0, /* Alt */ -
163 0, /* Ket */ -
164 0, /* KetRmax */ -
165 0, /* KetRmin */ -
166 0, /* KetRpos */ -
167 0, /* Reverse */ -
168 0, /* Assert */ -
169 0, /* Assert not */ -
170 0, /* Assert behind */ -
171 0, /* Assert behind not */ -
172 0, 0, /* ONCE, ONCE_NC */ -
173 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ -
174 0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */ -
175 0, 0, /* CREF, NCREF */ -
176 0, 0, /* RREF, NRREF */ -
177 0, /* DEF */ -
178 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ -
179 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ -
180 0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */ -
181 0, 0, 0, 0, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ -
182 0, 0 /* CLOSE, SKIPZERO */ -
183}; -
184 -
185/* This table identifies those opcodes that inspect a character. It is used to -
186remember the fact that a character could have been inspected when the end of -
187the subject is reached. ***NOTE*** If the start of this table is modified, the -
188two tables that follow must also be modified. */ -
189 -
190static const pcre_uint8 poptable[] = { -
191 0, /* End */ -
192 0, 0, 0, 1, 1, /* \A, \G, \K, \B, \b */ -
193 1, 1, 1, 1, 1, 1, /* \D, \d, \S, \s, \W, \w */ -
194 1, 1, 1, /* Any, AllAny, Anybyte */ -
195 1, 1, /* \P, \p */ -
196 1, 1, 1, 1, 1, /* \R, \H, \h, \V, \v */ -
197 1, /* \X */ -
198 0, 0, 0, 0, 0, 0, /* \Z, \z, ^, ^M, $, $M */ -
199 1, /* Char */ -
200 1, /* Chari */ -
201 1, /* not */ -
202 1, /* noti */ -
203 /* Positive single-char repeats */ -
204 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ -
205 1, 1, 1, /* upto, minupto, exact */ -
206 1, 1, 1, 1, /* *+, ++, ?+, upto+ */ -
207 1, 1, 1, 1, 1, 1, /* *I, *?I, +I, +?I, ?I, ??I */ -
208 1, 1, 1, /* upto I, minupto I, exact I */ -
209 1, 1, 1, 1, /* *+I, ++I, ?+I, upto+I */ -
210 /* Negative single-char repeats - only for chars < 256 */ -
211 1, 1, 1, 1, 1, 1, /* NOT *, *?, +, +?, ?, ?? */ -
212 1, 1, 1, /* NOT upto, minupto, exact */ -
213 1, 1, 1, 1, /* NOT *+, ++, ?+, upto+ */ -
214 1, 1, 1, 1, 1, 1, /* NOT *I, *?I, +I, +?I, ?I, ??I */ -
215 1, 1, 1, /* NOT upto I, minupto I, exact I */ -
216 1, 1, 1, 1, /* NOT *+I, ++I, ?+I, upto+I */ -
217 /* Positive type repeats */ -
218 1, 1, 1, 1, 1, 1, /* Type *, *?, +, +?, ?, ?? */ -
219 1, 1, 1, /* Type upto, minupto, exact */ -
220 1, 1, 1, 1, /* Type *+, ++, ?+, upto+ */ -
221 /* Character class & ref repeats */ -
222 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ -
223 1, 1, /* CRRANGE, CRMINRANGE */ -
224 1, /* CLASS */ -
225 1, /* NCLASS */ -
226 1, /* XCLASS - variable length */ -
227 0, /* REF */ -
228 0, /* REFI */ -
229 0, /* RECURSE */ -
230 0, /* CALLOUT */ -
231 0, /* Alt */ -
232 0, /* Ket */ -
233 0, /* KetRmax */ -
234 0, /* KetRmin */ -
235 0, /* KetRpos */ -
236 0, /* Reverse */ -
237 0, /* Assert */ -
238 0, /* Assert not */ -
239 0, /* Assert behind */ -
240 0, /* Assert behind not */ -
241 0, 0, /* ONCE, ONCE_NC */ -
242 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ -
243 0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */ -
244 0, 0, /* CREF, NCREF */ -
245 0, 0, /* RREF, NRREF */ -
246 0, /* DEF */ -
247 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ -
248 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ -
249 0, 0, 0, 0, /* SKIP, SKIP_ARG, THEN, THEN_ARG */ -
250 0, 0, 0, 0, /* COMMIT, FAIL, ACCEPT, ASSERT_ACCEPT */ -
251 0, 0 /* CLOSE, SKIPZERO */ -
252}; -
253 -
254/* These 2 tables allow for compact code for testing for \D, \d, \S, \s, \W, -
255and \w */ -
256 -
257static const pcre_uint8 toptable1[] = { -
258 0, 0, 0, 0, 0, 0, -
259 ctype_digit, ctype_digit, -
260 ctype_space, ctype_space, -
261 ctype_word, ctype_word, -
262 0, 0 /* OP_ANY, OP_ALLANY */ -
263}; -
264 -
265static const pcre_uint8 toptable2[] = { -
266 0, 0, 0, 0, 0, 0, -
267 ctype_digit, 0, -
268 ctype_space, 0, -
269 ctype_word, 0, -
270 1, 1 /* OP_ANY, OP_ALLANY */ -
271}; -
272 -
273 -
274/* Structure for holding data about a particular state, which is in effect the -
275current data for an active path through the match tree. It must consist -
276entirely of ints because the working vector we are passed, and which we put -
277these structures in, is a vector of ints. */ -
278 -
279typedef struct stateblock { -
280 int offset; /* Offset to opcode */ -
281 int count; /* Count for repeats */ -
282 int data; /* Some use extra data */ -
283} stateblock; -
284 -
285#define INTS_PER_STATEBLOCK (sizeof(stateblock)/sizeof(int)) -
286 -
287 -
288#ifdef PCRE_DEBUG -
289/************************************************* -
290* Print character string * -
291*************************************************/ -
292 -
293/* Character string printing function for debugging. -
294 -
295Arguments: -
296 p points to string -
297 length number of bytes -
298 f where to print -
299 -
300Returns: nothing -
301*/ -
302 -
303static void -
304pchars(const pcre_uchar *p, int length, FILE *f) -
305{ -
306int c; -
307while (length-- > 0) -
308 { -
309 if (isprint(c = *(p++))) -
310 fprintf(f, "%c", c); -
311 else -
312 fprintf(f, "\\x%02x", c); -
313 } -
314} -
315#endif -
316 -
317 -
318 -
319/************************************************* -
320* Execute a Regular Expression - DFA engine * -
321*************************************************/ -
322 -
323/* This internal function applies a compiled pattern to a subject string, -
324starting at a given point, using a DFA engine. This function is called from the -
325external one, possibly multiple times if the pattern is not anchored. The -
326function calls itself recursively for some kinds of subpattern. -
327 -
328Arguments: -
329 md the match_data block with fixed information -
330 this_start_code the opening bracket of this subexpression's code -
331 current_subject where we currently are in the subject string -
332 start_offset start offset in the subject string -
333 offsets vector to contain the matching string offsets -
334 offsetcount size of same -
335 workspace vector of workspace -
336 wscount size of same -
337 rlevel function call recursion level -
338 -
339Returns: > 0 => number of match offset pairs placed in offsets -
340 = 0 => offsets overflowed; longest matches are present -
341 -1 => failed to match -
342 < -1 => some kind of unexpected problem -
343 -
344The following macros are used for adding states to the two state vectors (one -
345for the current character, one for the following character). */ -
346 -
347#define ADD_ACTIVE(x,y) \ -
348 if (active_count++ < wscount) \ -
349 { \ -
350 next_active_state->offset = (x); \ -
351 next_active_state->count = (y); \ -
352 next_active_state++; \ -
353 DPRINTF(("%.*sADD_ACTIVE(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \ -
354 } \ -
355 else return PCRE_ERROR_DFA_WSSIZE -
356 -
357#define ADD_ACTIVE_DATA(x,y,z) \ -
358 if (active_count++ < wscount) \ -
359 { \ -
360 next_active_state->offset = (x); \ -
361 next_active_state->count = (y); \ -
362 next_active_state->data = (z); \ -
363 next_active_state++; \ -
364 DPRINTF(("%.*sADD_ACTIVE_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \ -
365 } \ -
366 else return PCRE_ERROR_DFA_WSSIZE -
367 -
368#define ADD_NEW(x,y) \ -
369 if (new_count++ < wscount) \ -
370 { \ -
371 next_new_state->offset = (x); \ -
372 next_new_state->count = (y); \ -
373 next_new_state++; \ -
374 DPRINTF(("%.*sADD_NEW(%d,%d)\n", rlevel*2-2, SP, (x), (y))); \ -
375 } \ -
376 else return PCRE_ERROR_DFA_WSSIZE -
377 -
378#define ADD_NEW_DATA(x,y,z) \ -
379 if (new_count++ < wscount) \ -
380 { \ -
381 next_new_state->offset = (x); \ -
382 next_new_state->count = (y); \ -
383 next_new_state->data = (z); \ -
384 next_new_state++; \ -
385 DPRINTF(("%.*sADD_NEW_DATA(%d,%d,%d)\n", rlevel*2-2, SP, (x), (y), (z))); \ -
386 } \ -
387 else return PCRE_ERROR_DFA_WSSIZE -
388 -
389/* And now, here is the code */ -
390 -
391static int -
392internal_dfa_exec( -
393 dfa_match_data *md, -
394 const pcre_uchar *this_start_code, -
395 const pcre_uchar *current_subject, -
396 int start_offset, -
397 int *offsets, -
398 int offsetcount, -
399 int *workspace, -
400 int wscount, -
401 int rlevel) -
402{ -
403stateblock *active_states, *new_states, *temp_states;
never executed (the execution status of this line is deduced): stateblock *active_states, *new_states, *temp_states;
-
404stateblock *next_active_state, *next_new_state;
never executed (the execution status of this line is deduced): stateblock *next_active_state, *next_new_state;
-
405 -
406const pcre_uint8 *ctypes, *lcc, *fcc;
never executed (the execution status of this line is deduced): const pcre_uint8 *ctypes, *lcc, *fcc;
-
407const pcre_uchar *ptr;
never executed (the execution status of this line is deduced): const pcre_uchar *ptr;
-
408const pcre_uchar *end_code, *first_op;
never executed (the execution status of this line is deduced): const pcre_uchar *end_code, *first_op;
-
409 -
410dfa_recursion_info new_recursive;
never executed (the execution status of this line is deduced): dfa_recursion_info new_recursive;
-
411 -
412int active_count, new_count, match_count;
never executed (the execution status of this line is deduced): int active_count, new_count, match_count;
-
413 -
414/* Some fields in the md block are frequently referenced, so we load them into -
415independent variables in the hope that this will perform better. */ -
416 -
417const pcre_uchar *start_subject = md->start_subject;
never executed (the execution status of this line is deduced): const pcre_uchar *start_subject = md->start_subject;
-
418const pcre_uchar *end_subject = md->end_subject;
never executed (the execution status of this line is deduced): const pcre_uchar *end_subject = md->end_subject;
-
419const pcre_uchar *start_code = md->start_code;
never executed (the execution status of this line is deduced): const pcre_uchar *start_code = md->start_code;
-
420 -
421#ifdef SUPPORT_UTF -
422BOOL utf = (md->poptions & PCRE_UTF8) != 0;
never executed (the execution status of this line is deduced): BOOL utf = (md->poptions & 0x00000800) != 0;
-
423#else -
424BOOL utf = FALSE; -
425#endif -
426 -
427rlevel++;
never executed (the execution status of this line is deduced): rlevel++;
-
428offsetcount &= (-2);
never executed (the execution status of this line is deduced): offsetcount &= (-2);
-
429 -
430wscount -= 2;
never executed (the execution status of this line is deduced): wscount -= 2;
-
431wscount = (wscount - (wscount % (INTS_PER_STATEBLOCK * 2))) /
never executed (the execution status of this line is deduced): wscount = (wscount - (wscount % ((sizeof(stateblock)/sizeof(int)) * 2))) /
-
432 (2 * INTS_PER_STATEBLOCK);
never executed (the execution status of this line is deduced): (2 * (sizeof(stateblock)/sizeof(int)));
-
433 -
434DPRINTF(("\n%.*s---------------------\n" -
435 "%.*sCall to internal_dfa_exec f=%d\n", -
436 rlevel*2-2, SP, rlevel*2-2, SP, rlevel)); -
437 -
438ctypes = md->tables + ctypes_offset;
never executed (the execution status of this line is deduced): ctypes = md->tables + (512 + 320);
-
439lcc = md->tables + lcc_offset;
never executed (the execution status of this line is deduced): lcc = md->tables + 0;
-
440fcc = md->tables + fcc_offset;
never executed (the execution status of this line is deduced): fcc = md->tables + 256;
-
441 -
442match_count = PCRE_ERROR_NOMATCH; /* A negative number */
never executed (the execution status of this line is deduced): match_count = (-1);
-
443 -
444active_states = (stateblock *)(workspace + 2);
never executed (the execution status of this line is deduced): active_states = (stateblock *)(workspace + 2);
-
445next_new_state = new_states = active_states + wscount;
never executed (the execution status of this line is deduced): next_new_state = new_states = active_states + wscount;
-
446new_count = 0;
never executed (the execution status of this line is deduced): new_count = 0;
-
447 -
448first_op = this_start_code + 1 + LINK_SIZE +
never executed (the execution status of this line is deduced): first_op = this_start_code + 1 + 1 +
-
449 ((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA ||
never evaluated: *this_start_code == OP_CBRA
never evaluated: *this_start_code == OP_SCBRA
0
450 *this_start_code == OP_CBRAPOS || *this_start_code == OP_SCBRAPOS)
never evaluated: *this_start_code == OP_CBRAPOS
never evaluated: *this_start_code == OP_SCBRAPOS
0
451 ? IMM2_SIZE:0);
never executed (the execution status of this line is deduced): ? 1:0);
-
452 -
453/* The first thing in any (sub) pattern is a bracket of some sort. Push all -
454the alternative states onto the list, and find out where the end is. This -
455makes is possible to use this function recursively, when we want to stop at a -
456matching internal ket rather than at the end. -
457 -
458If the first opcode in the first alternative is OP_REVERSE, we are dealing with -
459a backward assertion. In that case, we have to find out the maximum amount to -
460move back, and set up each alternative appropriately. */ -
461 -
462if (*first_op == OP_REVERSE)
never evaluated: *first_op == OP_REVERSE
0
463 { -
464 int max_back = 0;
never executed (the execution status of this line is deduced): int max_back = 0;
-
465 int gone_back;
never executed (the execution status of this line is deduced): int gone_back;
-
466 -
467 end_code = this_start_code;
never executed (the execution status of this line is deduced): end_code = this_start_code;
-
468 do -
469 { -
470 int back = GET(end_code, 2+LINK_SIZE);
never executed (the execution status of this line is deduced): int back = (end_code[2+1]);
-
471 if (back > max_back) max_back = back;
never executed: max_back = back;
never evaluated: back > max_back
0
472 end_code += GET(end_code, 1);
never executed (the execution status of this line is deduced): end_code += (end_code[1]);
-
473 }
never executed: }
0
474 while (*end_code == OP_ALT);
never evaluated: *end_code == OP_ALT
0
475 -
476 /* If we can't go back the amount required for the longest lookbehind -
477 pattern, go back as far as we can; some alternatives may still be viable. */ -
478 -
479#ifdef SUPPORT_UTF -
480 /* In character mode we have to step back character by character */ -
481 -
482 if (utf)
never evaluated: utf
0
483 { -
484 for (gone_back = 0; gone_back < max_back; gone_back++)
never evaluated: gone_back < max_back
0
485 { -
486 if (current_subject <= start_subject) break;
never executed: break;
never evaluated: current_subject <= start_subject
0
487 current_subject--;
never executed (the execution status of this line is deduced): current_subject--;
-
488 ACROSSCHAR(current_subject > start_subject, *current_subject, current_subject--);
never executed: current_subject--;
never evaluated: (current_subject > start_subject)
never evaluated: ((*current_subject) & 0xfc00) == 0xdc00
0
489 }
never executed: }
0
490 }
never executed: }
0
491 else -
492#endif -
493 -
494 /* In byte-mode we can do this quickly. */ -
495 -
496 { -
497 gone_back = (current_subject - max_back < start_subject)?
never evaluated: (current_subject - max_back < start_subject)
0
498 (int)(current_subject - start_subject) : max_back;
never executed (the execution status of this line is deduced): (int)(current_subject - start_subject) : max_back;
-
499 current_subject -= gone_back;
never executed (the execution status of this line is deduced): current_subject -= gone_back;
-
500 }
never executed: }
0
501 -
502 /* Save the earliest consulted character */ -
503 -
504 if (current_subject < md->start_used_ptr)
never evaluated: current_subject < md->start_used_ptr
0
505 md->start_used_ptr = current_subject;
never executed: md->start_used_ptr = current_subject;
0
506 -
507 /* Now we can process the individual branches. */ -
508 -
509 end_code = this_start_code;
never executed (the execution status of this line is deduced): end_code = this_start_code;
-
510 do -
511 { -
512 int back = GET(end_code, 2+LINK_SIZE);
never executed (the execution status of this line is deduced): int back = (end_code[2+1]);
-
513 if (back <= gone_back)
never evaluated: back <= gone_back
0
514 { -
515 int bstate = (int)(end_code - start_code + 2 + 2*LINK_SIZE);
never executed (the execution status of this line is deduced): int bstate = (int)(end_code - start_code + 2 + 2*1);
-
516 ADD_NEW_DATA(-bstate, 0, gone_back - back);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
517 } -
518 end_code += GET(end_code, 1);
never executed (the execution status of this line is deduced): end_code += (end_code[1]);
-
519 }
never executed: }
0
520 while (*end_code == OP_ALT);
never evaluated: *end_code == OP_ALT
0
521 }
never executed: }
0
522 -
523/* This is the code for a "normal" subpattern (not a backward assertion). The -
524start of a whole pattern is always one of these. If we are at the top level, -
525we may be asked to restart matching from the same point that we reached for a -
526previous partial match. We still have to scan through the top-level branches to -
527find the end state. */ -
528 -
529else -
530 { -
531 end_code = this_start_code;
never executed (the execution status of this line is deduced): end_code = this_start_code;
-
532 -
533 /* Restarting */ -
534 -
535 if (rlevel == 1 && (md->moptions & PCRE_DFA_RESTART) != 0)
never evaluated: rlevel == 1
never evaluated: (md->moptions & 0x00020000) != 0
0
536 { -
537 do { end_code += GET(end_code, 1); } while (*end_code == OP_ALT);
never executed: }
never evaluated: *end_code == OP_ALT
0
538 new_count = workspace[1];
never executed (the execution status of this line is deduced): new_count = workspace[1];
-
539 if (!workspace[0])
never evaluated: !workspace[0]
0
540 memcpy(new_states, active_states, new_count * sizeof(stateblock));
never executed: memcpy(new_states, active_states, new_count * sizeof(stateblock));
0
541 }
never executed: }
0
542 -
543 /* Not restarting */ -
544 -
545 else -
546 { -
547 int length = 1 + LINK_SIZE +
never executed (the execution status of this line is deduced): int length = 1 + 1 +
-
548 ((*this_start_code == OP_CBRA || *this_start_code == OP_SCBRA ||
never evaluated: *this_start_code == OP_CBRA
never evaluated: *this_start_code == OP_SCBRA
0
549 *this_start_code == OP_CBRAPOS || *this_start_code == OP_SCBRAPOS)
never evaluated: *this_start_code == OP_CBRAPOS
never evaluated: *this_start_code == OP_SCBRAPOS
0
550 ? IMM2_SIZE:0);
never executed (the execution status of this line is deduced): ? 1:0);
-
551 do -
552 { -
553 ADD_NEW((int)(end_code - start_code + length), 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
554 end_code += GET(end_code, 1);
never executed (the execution status of this line is deduced): end_code += (end_code[1]);
-
555 length = 1 + LINK_SIZE;
never executed (the execution status of this line is deduced): length = 1 + 1;
-
556 }
never executed: }
0
557 while (*end_code == OP_ALT);
never evaluated: *end_code == OP_ALT
0
558 }
never executed: }
0
559 } -
560 -
561workspace[0] = 0; /* Bit indicating which vector is current */
never executed (the execution status of this line is deduced): workspace[0] = 0;
-
562 -
563DPRINTF(("%.*sEnd state = %d\n", rlevel*2-2, SP, (int)(end_code - start_code))); -
564 -
565/* Loop for scanning the subject */ -
566 -
567ptr = current_subject;
never executed (the execution status of this line is deduced): ptr = current_subject;
-
568for (;;)
never executed (the execution status of this line is deduced): for (;;)
-
569 { -
570 int i, j;
never executed (the execution status of this line is deduced): int i, j;
-
571 int clen, dlen;
never executed (the execution status of this line is deduced): int clen, dlen;
-
572 unsigned int c, d;
never executed (the execution status of this line is deduced): unsigned int c, d;
-
573 int forced_fail = 0;
never executed (the execution status of this line is deduced): int forced_fail = 0;
-
574 BOOL could_continue = FALSE;
never executed (the execution status of this line is deduced): BOOL could_continue = 0;
-
575 -
576 /* Make the new state list into the active state list and empty the -
577 new state list. */ -
578 -
579 temp_states = active_states;
never executed (the execution status of this line is deduced): temp_states = active_states;
-
580 active_states = new_states;
never executed (the execution status of this line is deduced): active_states = new_states;
-
581 new_states = temp_states;
never executed (the execution status of this line is deduced): new_states = temp_states;
-
582 active_count = new_count;
never executed (the execution status of this line is deduced): active_count = new_count;
-
583 new_count = 0;
never executed (the execution status of this line is deduced): new_count = 0;
-
584 -
585 workspace[0] ^= 1; /* Remember for the restarting feature */
never executed (the execution status of this line is deduced): workspace[0] ^= 1;
-
586 workspace[1] = active_count;
never executed (the execution status of this line is deduced): workspace[1] = active_count;
-
587 -
588#ifdef PCRE_DEBUG -
589 printf("%.*sNext character: rest of subject = \"", rlevel*2-2, SP); -
590 pchars(ptr, STRLEN_UC(ptr), stdout); -
591 printf("\"\n"); -
592 -
593 printf("%.*sActive states: ", rlevel*2-2, SP); -
594 for (i = 0; i < active_count; i++) -
595 printf("%d/%d ", active_states[i].offset, active_states[i].count); -
596 printf("\n"); -
597#endif -
598 -
599 /* Set the pointers for adding new states */ -
600 -
601 next_active_state = active_states + active_count;
never executed (the execution status of this line is deduced): next_active_state = active_states + active_count;
-
602 next_new_state = new_states;
never executed (the execution status of this line is deduced): next_new_state = new_states;
-
603 -
604 /* Load the current character from the subject outside the loop, as many -
605 different states may want to look at it, and we assume that at least one -
606 will. */ -
607 -
608 if (ptr < end_subject)
never evaluated: ptr < end_subject
0
609 { -
610 clen = 1; /* Number of bytes in the character */
never executed (the execution status of this line is deduced): clen = 1;
-
611#ifdef SUPPORT_UTF -
612 if (utf) { GETCHARLEN(c, ptr, clen); } else
never executed: }
never executed: }
never evaluated: (c & 0xfc00) == 0xd800
never evaluated: utf
0
613#endif /* SUPPORT_UTF */ -
614 c = *ptr;
never executed: c = *ptr;
0
615 } -
616 else -
617 { -
618 clen = 0; /* This indicates the end of the subject */
never executed (the execution status of this line is deduced): clen = 0;
-
619 c = NOTACHAR; /* This value should never actually be used */
never executed (the execution status of this line is deduced): c = 0xffffffff;
-
620 }
never executed: }
0
621 -
622 /* Scan up the active states and act on each one. The result of an action -
623 may be to add more states to the currently active list (e.g. on hitting a -
624 parenthesis) or it may be to put states on the new list, for considering -
625 when we move the character pointer on. */ -
626 -
627 for (i = 0; i < active_count; i++)
never evaluated: i < active_count
0
628 { -
629 stateblock *current_state = active_states + i;
never executed (the execution status of this line is deduced): stateblock *current_state = active_states + i;
-
630 BOOL caseless = FALSE;
never executed (the execution status of this line is deduced): BOOL caseless = 0;
-
631 const pcre_uchar *code;
never executed (the execution status of this line is deduced): const pcre_uchar *code;
-
632 int state_offset = current_state->offset;
never executed (the execution status of this line is deduced): int state_offset = current_state->offset;
-
633 int count, codevalue, rrc;
never executed (the execution status of this line is deduced): int count, codevalue, rrc;
-
634 -
635#ifdef PCRE_DEBUG -
636 printf ("%.*sProcessing state %d c=", rlevel*2-2, SP, state_offset); -
637 if (clen == 0) printf("EOL\n"); -
638 else if (c > 32 && c < 127) printf("'%c'\n", c); -
639 else printf("0x%02x\n", c); -
640#endif -
641 -
642 /* A negative offset is a special case meaning "hold off going to this -
643 (negated) state until the number of characters in the data field have -
644 been skipped". */ -
645 -
646 if (state_offset < 0)
never evaluated: state_offset < 0
0
647 { -
648 if (current_state->data > 0)
never evaluated: current_state->data > 0
0
649 { -
650 DPRINTF(("%.*sSkipping this character\n", rlevel*2-2, SP)); -
651 ADD_NEW_DATA(state_offset, current_state->count,
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
652 current_state->data - 1); -
653 continue;
never executed: continue;
0
654 } -
655 else -
656 { -
657 current_state->offset = state_offset = -state_offset;
never executed (the execution status of this line is deduced): current_state->offset = state_offset = -state_offset;
-
658 }
never executed: }
0
659 } -
660 -
661 /* Check for a duplicate state with the same count, and skip if found. -
662 See the note at the head of this module about the possibility of improving -
663 performance here. */ -
664 -
665 for (j = 0; j < i; j++)
never evaluated: j < i
0
666 { -
667 if (active_states[j].offset == state_offset &&
never evaluated: active_states[j].offset == state_offset
0
668 active_states[j].count == current_state->count)
never evaluated: active_states[j].count == current_state->count
0
669 { -
670 DPRINTF(("%.*sDuplicate state: skipped\n", rlevel*2-2, SP)); -
671 goto NEXT_ACTIVE_STATE;
never executed: goto NEXT_ACTIVE_STATE;
0
672 } -
673 }
never executed: }
0
674 -
675 /* The state offset is the offset to the opcode */ -
676 -
677 code = start_code + state_offset;
never executed (the execution status of this line is deduced): code = start_code + state_offset;
-
678 codevalue = *code;
never executed (the execution status of this line is deduced): codevalue = *code;
-
679 -
680 /* If this opcode inspects a character, but we are at the end of the -
681 subject, remember the fact for use when testing for a partial match. */ -
682 -
683 if (clen == 0 && poptable[codevalue] != 0)
never evaluated: clen == 0
never evaluated: poptable[codevalue] != 0
0
684 could_continue = TRUE;
never executed: could_continue = 1;
0
685 -
686 /* If this opcode is followed by an inline character, load it. It is -
687 tempting to test for the presence of a subject character here, but that -
688 is wrong, because sometimes zero repetitions of the subject are -
689 permitted. -
690 -
691 We also use this mechanism for opcodes such as OP_TYPEPLUS that take an -
692 argument that is not a data character - but is always one byte long. We -
693 have to take special action to deal with \P, \p, \H, \h, \V, \v and \X in -
694 this case. To keep the other cases fast, convert these ones to new opcodes. -
695 */ -
696 -
697 if (coptable[codevalue] > 0)
never evaluated: coptable[codevalue] > 0
0
698 { -
699 dlen = 1;
never executed (the execution status of this line is deduced): dlen = 1;
-
700#ifdef SUPPORT_UTF -
701 if (utf) { GETCHARLEN(d, (code + coptable[codevalue]), dlen); } else
never executed: }
never executed: }
never evaluated: (d & 0xfc00) == 0xd800
never evaluated: utf
0
702#endif /* SUPPORT_UTF */ -
703 d = code[coptable[codevalue]];
never executed: d = code[coptable[codevalue]];
0
704 if (codevalue >= OP_TYPESTAR)
never evaluated: codevalue >= OP_TYPESTAR
0
705 { -
706 switch(d) -
707 { -
708 case OP_ANYBYTE: return PCRE_ERROR_DFA_UITEM;
never executed: return (-16);
0
709 case OP_NOTPROP: -
710 case OP_PROP: codevalue += OP_PROP_EXTRA; break;
never executed: break;
0
711 case OP_ANYNL: codevalue += OP_ANYNL_EXTRA; break;
never executed: break;
0
712 case OP_EXTUNI: codevalue += OP_EXTUNI_EXTRA; break;
never executed: break;
0
713 case OP_NOT_HSPACE: -
714 case OP_HSPACE: codevalue += OP_HSPACE_EXTRA; break;
never executed: break;
0
715 case OP_NOT_VSPACE: -
716 case OP_VSPACE: codevalue += OP_VSPACE_EXTRA; break;
never executed: break;
0
717 default: break;
never executed: break;
0
718 } -
719 }
never executed: }
0
720 }
never executed: }
0
721 else -
722 { -
723 dlen = 0; /* Not strictly necessary, but compilers moan */
never executed (the execution status of this line is deduced): dlen = 0;
-
724 d = NOTACHAR; /* if these variables are not set. */
never executed (the execution status of this line is deduced): d = 0xffffffff;
-
725 }
never executed: }
0
726 -
727 -
728 /* Now process the individual opcodes */ -
729 -
730 switch (codevalue) -
731 { -
732/* ========================================================================== */ -
733 /* These cases are never obeyed. This is a fudge that causes a compile- -
734 time error if the vectors coptable or poptable, which are indexed by -
735 opcode, are not the correct length. It seems to be the only way to do -
736 such a check at compile time, as the sizeof() operator does not work -
737 in the C preprocessor. */ -
738 -
739 case OP_TABLE_LENGTH: -
740 case OP_TABLE_LENGTH + -
741 ((sizeof(coptable) == OP_TABLE_LENGTH) && -
742 (sizeof(poptable) == OP_TABLE_LENGTH)): -
743 break;
never executed: break;
0
744 -
745/* ========================================================================== */ -
746 /* Reached a closing bracket. If not at the end of the pattern, carry -
747 on with the next opcode. For repeating opcodes, also add the repeat -
748 state. Note that KETRPOS will always be encountered at the end of the -
749 subpattern, because the possessive subpattern repeats are always handled -
750 using recursive calls. Thus, it never adds any new states. -
751 -
752 At the end of the (sub)pattern, unless we have an empty string and -
753 PCRE_NOTEMPTY is set, or PCRE_NOTEMPTY_ATSTART is set and we are at the -
754 start of the subject, save the match data, shifting up all previous -
755 matches so we always have the longest first. */ -
756 -
757 case OP_KET: -
758 case OP_KETRMIN: -
759 case OP_KETRMAX: -
760 case OP_KETRPOS: -
761 if (code != end_code)
never evaluated: code != end_code
0
762 { -
763 ADD_ACTIVE(state_offset + 1 + LINK_SIZE, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
764 if (codevalue != OP_KET)
never evaluated: codevalue != OP_KET
0
765 { -
766 ADD_ACTIVE(state_offset - GET(code, 1), 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
767 } -
768 }
never executed: }
0
769 else -
770 { -
771 if (ptr > current_subject ||
never evaluated: ptr > current_subject
0
772 ((md->moptions & PCRE_NOTEMPTY) == 0 &&
never evaluated: (md->moptions & 0x00000400) == 0
0
773 ((md->moptions & PCRE_NOTEMPTY_ATSTART) == 0 ||
never evaluated: (md->moptions & 0x10000000) == 0
0
774 current_subject > start_subject + md->start_offset)))
never evaluated: current_subject > start_subject + md->start_offset
0
775 { -
776 if (match_count < 0) match_count = (offsetcount >= 2)? 1 : 0;
never executed: match_count = (offsetcount >= 2)? 1 : 0;
never evaluated: match_count < 0
never evaluated: (offsetcount >= 2)
0
777 else if (match_count > 0 && ++match_count * 2 > offsetcount)
never evaluated: match_count > 0
never evaluated: ++match_count * 2 > offsetcount
0
778 match_count = 0;
never executed: match_count = 0;
0
779 count = ((match_count == 0)? offsetcount : match_count * 2) - 2;
never evaluated: (match_count == 0)
0
780 if (count > 0) memmove(offsets + 2, offsets, count * sizeof(int));
never executed: memmove(offsets + 2, offsets, count * sizeof(int));
never evaluated: count > 0
0
781 if (offsetcount >= 2)
never evaluated: offsetcount >= 2
0
782 { -
783 offsets[0] = (int)(current_subject - start_subject);
never executed (the execution status of this line is deduced): offsets[0] = (int)(current_subject - start_subject);
-
784 offsets[1] = (int)(ptr - start_subject);
never executed (the execution status of this line is deduced): offsets[1] = (int)(ptr - start_subject);
-
785 DPRINTF(("%.*sSet matched string = \"%.*s\"\n", rlevel*2-2, SP, -
786 offsets[1] - offsets[0], current_subject)); -
787 }
never executed: }
0
788 if ((md->moptions & PCRE_DFA_SHORTEST) != 0)
never evaluated: (md->moptions & 0x00010000) != 0
0
789 { -
790 DPRINTF(("%.*sEnd of internal_dfa_exec %d: returning %d\n" -
791 "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, -
792 match_count, rlevel*2-2, SP)); -
793 return match_count;
never executed: return match_count;
0
794 } -
795 }
never executed: }
0
796 }
never executed: }
0
797 break;
never executed: break;
0
798 -
799/* ========================================================================== */ -
800 /* These opcodes add to the current list of states without looking -
801 at the current character. */ -
802 -
803 /*-----------------------------------------------------------------*/ -
804 case OP_ALT: -
805 do { code += GET(code, 1); } while (*code == OP_ALT);
never executed: }
never evaluated: *code == OP_ALT
0
806 ADD_ACTIVE((int)(code - start_code), 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
807 break;
never executed: break;
0
808 -
809 /*-----------------------------------------------------------------*/ -
810 case OP_BRA: -
811 case OP_SBRA: -
812 do -
813 { -
814 ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
815 code += GET(code, 1);
never executed (the execution status of this line is deduced): code += (code[1]);
-
816 }
never executed: }
0
817 while (*code == OP_ALT);
never evaluated: *code == OP_ALT
0
818 break;
never executed: break;
0
819 -
820 /*-----------------------------------------------------------------*/ -
821 case OP_CBRA: -
822 case OP_SCBRA: -
823 ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE + IMM2_SIZE), 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
824 code += GET(code, 1);
never executed (the execution status of this line is deduced): code += (code[1]);
-
825 while (*code == OP_ALT)
never evaluated: *code == OP_ALT
0
826 { -
827 ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
828 code += GET(code, 1);
never executed (the execution status of this line is deduced): code += (code[1]);
-
829 }
never executed: }
0
830 break;
never executed: break;
0
831 -
832 /*-----------------------------------------------------------------*/ -
833 case OP_BRAZERO: -
834 case OP_BRAMINZERO: -
835 ADD_ACTIVE(state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
836 code += 1 + GET(code, 2);
never executed (the execution status of this line is deduced): code += 1 + (code[2]);
-
837 while (*code == OP_ALT) code += GET(code, 1);
never executed: code += (code[1]);
never evaluated: *code == OP_ALT
0
838 ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
839 break;
never executed: break;
0
840 -
841 /*-----------------------------------------------------------------*/ -
842 case OP_SKIPZERO: -
843 code += 1 + GET(code, 2);
never executed (the execution status of this line is deduced): code += 1 + (code[2]);
-
844 while (*code == OP_ALT) code += GET(code, 1);
never executed: code += (code[1]);
never evaluated: *code == OP_ALT
0
845 ADD_ACTIVE((int)(code - start_code + 1 + LINK_SIZE), 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
846 break;
never executed: break;
0
847 -
848 /*-----------------------------------------------------------------*/ -
849 case OP_CIRC: -
850 if (ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0)
never evaluated: ptr == start_subject
never evaluated: (md->moptions & 0x00000080) == 0
0
851 { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
852 break;
never executed: break;
0
853 -
854 /*-----------------------------------------------------------------*/ -
855 case OP_CIRCM: -
856 if ((ptr == start_subject && (md->moptions & PCRE_NOTBOL) == 0) ||
never evaluated: ptr == start_subject
never evaluated: (md->moptions & 0x00000080) == 0
0
857 (ptr != end_subject && WAS_NEWLINE(ptr)))
never evaluated: ptr != end_subject
never evaluated: (md->nltype != 0)
0
858 { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
859 break;
never executed: break;
0
860 -
861 /*-----------------------------------------------------------------*/ -
862 case OP_EOD: -
863 if (ptr >= end_subject)
never evaluated: ptr >= end_subject
0
864 { -
865 if ((md->moptions & PCRE_PARTIAL_HARD) != 0)
never evaluated: (md->moptions & 0x08000000) != 0
0
866 could_continue = TRUE;
never executed: could_continue = 1;
0
867 else { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
868 } -
869 break;
never executed: break;
0
870 -
871 /*-----------------------------------------------------------------*/ -
872 case OP_SOD: -
873 if (ptr == start_subject) { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: ptr == start_subject
never evaluated: active_count++ < wscount
0
874 break;
never executed: break;
0
875 -
876 /*-----------------------------------------------------------------*/ -
877 case OP_SOM: -
878 if (ptr == start_subject + start_offset) { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: ptr == start_subject + start_offset
never evaluated: active_count++ < wscount
0
879 break;
never executed: break;
0
880 -
881 -
882/* ========================================================================== */ -
883 /* These opcodes inspect the next subject character, and sometimes -
884 the previous one as well, but do not have an argument. The variable -
885 clen contains the length of the current character and is zero if we are -
886 at the end of the subject. */ -
887 -
888 /*-----------------------------------------------------------------*/ -
889 case OP_ANY: -
890 if (clen > 0 && !IS_NEWLINE(ptr))
never evaluated: clen > 0
never evaluated: (md->nltype != 0)
0
891 { ADD_NEW(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
892 break;
never executed: break;
0
893 -
894 /*-----------------------------------------------------------------*/ -
895 case OP_ALLANY: -
896 if (clen > 0)
never evaluated: clen > 0
0
897 { ADD_NEW(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
898 break;
never executed: break;
0
899 -
900 /*-----------------------------------------------------------------*/ -
901 case OP_EODN: -
902 if (clen == 0 && (md->moptions & PCRE_PARTIAL_HARD) != 0)
never evaluated: clen == 0
never evaluated: (md->moptions & 0x08000000) != 0
0
903 could_continue = TRUE;
never executed: could_continue = 1;
0
904 else if (clen == 0 || (IS_NEWLINE(ptr) && ptr == end_subject - md->nllen))
never evaluated: clen == 0
never evaluated: (md->nltype != 0)
never evaluated: ptr == end_subject - md->nllen
0
905 { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
906 break;
never executed: break;
0
907 -
908 /*-----------------------------------------------------------------*/ -
909 case OP_DOLL: -
910 if ((md->moptions & PCRE_NOTEOL) == 0)
never evaluated: (md->moptions & 0x00000100) == 0
0
911 { -
912 if (clen == 0 && (md->moptions & PCRE_PARTIAL_HARD) != 0)
never evaluated: clen == 0
never evaluated: (md->moptions & 0x08000000) != 0
0
913 could_continue = TRUE;
never executed: could_continue = 1;
0
914 else if (clen == 0 ||
never evaluated: clen == 0
0
915 ((md->poptions & PCRE_DOLLAR_ENDONLY) == 0 && IS_NEWLINE(ptr) &&
never evaluated: (md->poptions & 0x00000020) == 0
never evaluated: (md->nltype != 0)
0
916 (ptr == end_subject - md->nllen)
never evaluated: (ptr == end_subject - md->nllen)
0
917 ))
never executed (the execution status of this line is deduced): ))
-
918 { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
919 } -
920 break;
never executed: break;
0
921 -
922 /*-----------------------------------------------------------------*/ -
923 case OP_DOLLM: -
924 if ((md->moptions & PCRE_NOTEOL) == 0)
never evaluated: (md->moptions & 0x00000100) == 0
0
925 { -
926 if (clen == 0 && (md->moptions & PCRE_PARTIAL_HARD) != 0)
never evaluated: clen == 0
never evaluated: (md->moptions & 0x08000000) != 0
0
927 could_continue = TRUE;
never executed: could_continue = 1;
0
928 else if (clen == 0 ||
never evaluated: clen == 0
0
929 ((md->poptions & PCRE_DOLLAR_ENDONLY) == 0 && IS_NEWLINE(ptr)))
never evaluated: (md->poptions & 0x00000020) == 0
never evaluated: (md->nltype != 0)
0
930 { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
931 } -
932 else if (IS_NEWLINE(ptr))
never evaluated: (md->nltype != 0)
0
933 { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
934 break;
never executed: break;
0
935 -
936 /*-----------------------------------------------------------------*/ -
937 -
938 case OP_DIGIT: -
939 case OP_WHITESPACE: -
940 case OP_WORDCHAR: -
941 if (clen > 0 && c < 256 &&
never evaluated: clen > 0
never evaluated: c < 256
0
942 ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0)
never evaluated: ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0
0
943 { ADD_NEW(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
944 break;
never executed: break;
0
945 -
946 /*-----------------------------------------------------------------*/ -
947 case OP_NOT_DIGIT: -
948 case OP_NOT_WHITESPACE: -
949 case OP_NOT_WORDCHAR: -
950 if (clen > 0 && (c >= 256 ||
never evaluated: clen > 0
never evaluated: c >= 256
0
951 ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0))
never evaluated: ((ctypes[c] & toptable1[codevalue]) ^ toptable2[codevalue]) != 0
0
952 { ADD_NEW(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
953 break;
never executed: break;
0
954 -
955 /*-----------------------------------------------------------------*/ -
956 case OP_WORD_BOUNDARY: -
957 case OP_NOT_WORD_BOUNDARY: -
958 { -
959 int left_word, right_word;
never executed (the execution status of this line is deduced): int left_word, right_word;
-
960 -
961 if (ptr > start_subject)
never evaluated: ptr > start_subject
0
962 { -
963 const pcre_uchar *temp = ptr - 1;
never executed (the execution status of this line is deduced): const pcre_uchar *temp = ptr - 1;
-
964 if (temp < md->start_used_ptr) md->start_used_ptr = temp;
never executed: md->start_used_ptr = temp;
never evaluated: temp < md->start_used_ptr
0
965#ifdef SUPPORT_UTF -
966 if (utf) { BACKCHAR(temp); }
never executed: temp--;
never executed: }
never evaluated: utf
never evaluated: (*temp & 0xfc00) == 0xdc00
0
967#endif -
968 GETCHARTEST(d, temp);
never executed: }
never evaluated: utf
never evaluated: (d & 0xfc00) == 0xd800
0
969#ifdef SUPPORT_UCP -
970 if ((md->poptions & PCRE_UCP) != 0)
never evaluated: (md->poptions & 0x20000000) != 0
0
971 { -
972 if (d == '_') left_word = TRUE; else
never executed: left_word = 1;
never evaluated: d == '_'
0
973 { -
974 int cat = UCD_CATEGORY(d);
never executed (the execution status of this line is deduced): int cat = _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(d) / 128] * 128 + (d) % 128])->chartype];
-
975 left_word = (cat == ucp_L || cat == ucp_N);
never evaluated: cat == ucp_L
never evaluated: cat == ucp_N
0
976 }
never executed: }
0
977 } -
978 else -
979#endif -
980 left_word = d < 256 && (ctypes[d] & ctype_word) != 0;
never executed: left_word = d < 256 && (ctypes[d] & 0x10) != 0;
never evaluated: d < 256
never evaluated: (ctypes[d] & 0x10) != 0
0
981 } -
982 else left_word = FALSE;
never executed: left_word = 0;
0
983 -
984 if (clen > 0)
never evaluated: clen > 0
0
985 { -
986#ifdef SUPPORT_UCP -
987 if ((md->poptions & PCRE_UCP) != 0)
never evaluated: (md->poptions & 0x20000000) != 0
0
988 { -
989 if (c == '_') right_word = TRUE; else
never executed: right_word = 1;
never evaluated: c == '_'
0
990 { -
991 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];
-
992 right_word = (cat == ucp_L || cat == ucp_N);
never evaluated: cat == ucp_L
never evaluated: cat == ucp_N
0
993 }
never executed: }
0
994 } -
995 else -
996#endif -
997 right_word = c < 256 && (ctypes[c] & ctype_word) != 0;
never executed: right_word = c < 256 && (ctypes[c] & 0x10) != 0;
never evaluated: c < 256
never evaluated: (ctypes[c] & 0x10) != 0
0
998 } -
999 else right_word = FALSE;
never executed: right_word = 0;
0
1000 -
1001 if ((left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY))
never evaluated: (left_word == right_word) == (codevalue == OP_NOT_WORD_BOUNDARY)
0
1002 { ADD_ACTIVE(state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1003 } -
1004 break;
never executed: break;
0
1005 -
1006 -
1007 /*-----------------------------------------------------------------*/ -
1008 /* Check the next character by Unicode property. We will get here only -
1009 if the support is in the binary; otherwise a compile-time error occurs. -
1010 */ -
1011 -
1012#ifdef SUPPORT_UCP -
1013 case OP_PROP: -
1014 case OP_NOTPROP: -
1015 if (clen > 0)
never evaluated: clen > 0
0
1016 { -
1017 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1018 const ucd_record * prop = GET_UCD(c);
never 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]);
-
1019 switch(code[1]) -
1020 { -
1021 case PT_ANY: -
1022 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1023 break;
never executed: break;
0
1024 -
1025 case PT_LAMP: -
1026 OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
never evaluated: prop->chartype == ucp_Lu
never evaluated: prop->chartype == ucp_Ll
0
1027 prop->chartype == ucp_Lt;
never evaluated: prop->chartype == ucp_Lt
0
1028 break;
never executed: break;
0
1029 -
1030 case PT_GC: -
1031 OK = PRIV(ucp_gentype)[prop->chartype] == code[2];
never executed (the execution status of this line is deduced): OK = _pcre16_ucp_gentype[prop->chartype] == code[2];
-
1032 break;
never executed: break;
0
1033 -
1034 case PT_PC: -
1035 OK = prop->chartype == code[2];
never executed (the execution status of this line is deduced): OK = prop->chartype == code[2];
-
1036 break;
never executed: break;
0
1037 -
1038 case PT_SC: -
1039 OK = prop->script == code[2];
never executed (the execution status of this line is deduced): OK = prop->script == code[2];
-
1040 break;
never executed: break;
0
1041 -
1042 /* These are specials for combination cases. */ -
1043 -
1044 case PT_ALNUM: -
1045 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L
0
1046 PRIV(ucp_gentype)[prop->chartype] == ucp_N;
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N
0
1047 break;
never executed: break;
0
1048 -
1049 case PT_SPACE: /* Perl space */ -
1050 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z
0
1051 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
never evaluated: c == '\011'
never evaluated: c == '\012'
never evaluated: c == '\014'
never evaluated: c == '\015'
0
1052 break;
never executed: break;
0
1053 -
1054 case PT_PXSPACE: /* POSIX space */ -
1055 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z
0
1056 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
never evaluated: c == '\011'
never evaluated: c == '\012'
never evaluated: c == '\013'
0
1057 c == CHAR_FF || c == CHAR_CR;
never evaluated: c == '\014'
never evaluated: c == '\015'
0
1058 break;
never executed: break;
0
1059 -
1060 case PT_WORD: -
1061 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L
0
1062 PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N
0
1063 c == CHAR_UNDERSCORE;
never evaluated: c == '\137'
0
1064 break;
never executed: break;
0
1065 -
1066 /* Should never occur, but keep compilers from grumbling. */ -
1067 -
1068 default: -
1069 OK = codevalue != OP_PROP;
never executed (the execution status of this line is deduced): OK = codevalue != OP_PROP;
-
1070 break;
never executed: break;
0
1071 } -
1072 -
1073 if (OK == (codevalue == OP_PROP)) { ADD_NEW(state_offset + 3, 0); }
never executed: }
never executed: return (-19);
never evaluated: OK == (codevalue == OP_PROP)
never evaluated: new_count++ < wscount
0
1074 }
never executed: }
0
1075 break;
never executed: break;
0
1076#endif -
1077 -
1078 -
1079 -
1080/* ========================================================================== */ -
1081 /* These opcodes likewise inspect the subject character, but have an -
1082 argument that is not a data character. It is one of these opcodes: -
1083 OP_ANY, OP_ALLANY, OP_DIGIT, OP_NOT_DIGIT, OP_WHITESPACE, OP_NOT_SPACE, -
1084 OP_WORDCHAR, OP_NOT_WORDCHAR. The value is loaded into d. */ -
1085 -
1086 case OP_TYPEPLUS: -
1087 case OP_TYPEMINPLUS: -
1088 case OP_TYPEPOSPLUS: -
1089 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1090 if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); }
never executed: }
never executed: return (-19);
never evaluated: count > 0
never evaluated: active_count++ < wscount
0
1091 if (clen > 0)
never evaluated: clen > 0
0
1092 { -
1093 if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||
never evaluated: c >= 256
never evaluated: d != OP_DIGIT
never evaluated: d != OP_WHITESPACE
never evaluated: d != OP_WORDCHAR
0
1094 (c < 256 &&
never evaluated: c < 256
0
1095 (d != OP_ANY || !IS_NEWLINE(ptr)) &&
never evaluated: d != OP_ANY
never evaluated: (md->nltype != 0)
0
1096 ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))
never evaluated: ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0
0
1097 { -
1098 if (count > 0 && codevalue == OP_TYPEPOSPLUS)
never evaluated: count > 0
never evaluated: codevalue == OP_TYPEPOSPLUS
0
1099 { -
1100 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1101 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1102 }
never executed: }
0
1103 count++;
never executed (the execution status of this line is deduced): count++;
-
1104 ADD_NEW(state_offset, count);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1105 } -
1106 }
never executed: }
0
1107 break;
never executed: break;
0
1108 -
1109 /*-----------------------------------------------------------------*/ -
1110 case OP_TYPEQUERY: -
1111 case OP_TYPEMINQUERY: -
1112 case OP_TYPEPOSQUERY: -
1113 ADD_ACTIVE(state_offset + 2, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1114 if (clen > 0)
never evaluated: clen > 0
0
1115 { -
1116 if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||
never evaluated: c >= 256
never evaluated: d != OP_DIGIT
never evaluated: d != OP_WHITESPACE
never evaluated: d != OP_WORDCHAR
0
1117 (c < 256 &&
never evaluated: c < 256
0
1118 (d != OP_ANY || !IS_NEWLINE(ptr)) &&
never evaluated: d != OP_ANY
never evaluated: (md->nltype != 0)
0
1119 ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))
never evaluated: ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0
0
1120 { -
1121 if (codevalue == OP_TYPEPOSQUERY)
never evaluated: codevalue == OP_TYPEPOSQUERY
0
1122 { -
1123 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1124 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1125 }
never executed: }
0
1126 ADD_NEW(state_offset + 2, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1127 } -
1128 }
never executed: }
0
1129 break;
never executed: break;
0
1130 -
1131 /*-----------------------------------------------------------------*/ -
1132 case OP_TYPESTAR: -
1133 case OP_TYPEMINSTAR: -
1134 case OP_TYPEPOSSTAR: -
1135 ADD_ACTIVE(state_offset + 2, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1136 if (clen > 0)
never evaluated: clen > 0
0
1137 { -
1138 if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||
never evaluated: c >= 256
never evaluated: d != OP_DIGIT
never evaluated: d != OP_WHITESPACE
never evaluated: d != OP_WORDCHAR
0
1139 (c < 256 &&
never evaluated: c < 256
0
1140 (d != OP_ANY || !IS_NEWLINE(ptr)) &&
never evaluated: d != OP_ANY
never evaluated: (md->nltype != 0)
0
1141 ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))
never evaluated: ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0
0
1142 { -
1143 if (codevalue == OP_TYPEPOSSTAR)
never evaluated: codevalue == OP_TYPEPOSSTAR
0
1144 { -
1145 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1146 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1147 }
never executed: }
0
1148 ADD_NEW(state_offset, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1149 } -
1150 }
never executed: }
0
1151 break;
never executed: break;
0
1152 -
1153 /*-----------------------------------------------------------------*/ -
1154 case OP_TYPEEXACT: -
1155 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1156 if (clen > 0)
never evaluated: clen > 0
0
1157 { -
1158 if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||
never evaluated: c >= 256
never evaluated: d != OP_DIGIT
never evaluated: d != OP_WHITESPACE
never evaluated: d != OP_WORDCHAR
0
1159 (c < 256 &&
never evaluated: c < 256
0
1160 (d != OP_ANY || !IS_NEWLINE(ptr)) &&
never evaluated: d != OP_ANY
never evaluated: (md->nltype != 0)
0
1161 ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))
never evaluated: ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0
0
1162 { -
1163 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
1164 { ADD_NEW(state_offset + 1 + IMM2_SIZE + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1165 else -
1166 { ADD_NEW(state_offset, count); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1167 } -
1168 }
never executed: }
0
1169 break;
never executed: break;
0
1170 -
1171 /*-----------------------------------------------------------------*/ -
1172 case OP_TYPEUPTO: -
1173 case OP_TYPEMINUPTO: -
1174 case OP_TYPEPOSUPTO: -
1175 ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1176 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1177 if (clen > 0)
never evaluated: clen > 0
0
1178 { -
1179 if ((c >= 256 && d != OP_DIGIT && d != OP_WHITESPACE && d != OP_WORDCHAR) ||
never evaluated: c >= 256
never evaluated: d != OP_DIGIT
never evaluated: d != OP_WHITESPACE
never evaluated: d != OP_WORDCHAR
0
1180 (c < 256 &&
never evaluated: c < 256
0
1181 (d != OP_ANY || !IS_NEWLINE(ptr)) &&
never evaluated: d != OP_ANY
never evaluated: (md->nltype != 0)
0
1182 ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0))
never evaluated: ((ctypes[c] & toptable1[d]) ^ toptable2[d]) != 0
0
1183 { -
1184 if (codevalue == OP_TYPEPOSUPTO)
never evaluated: codevalue == OP_TYPEPOSUPTO
0
1185 { -
1186 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1187 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1188 }
never executed: }
0
1189 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
1190 { ADD_NEW(state_offset + 2 + IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1191 else -
1192 { ADD_NEW(state_offset, count); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1193 } -
1194 }
never executed: }
0
1195 break;
never executed: break;
0
1196 -
1197/* ========================================================================== */ -
1198 /* These are virtual opcodes that are used when something like -
1199 OP_TYPEPLUS has OP_PROP, OP_NOTPROP, OP_ANYNL, or OP_EXTUNI as its -
1200 argument. It keeps the code above fast for the other cases. The argument -
1201 is in the d variable. */ -
1202 -
1203#ifdef SUPPORT_UCP -
1204 case OP_PROP_EXTRA + OP_TYPEPLUS: -
1205 case OP_PROP_EXTRA + OP_TYPEMINPLUS: -
1206 case OP_PROP_EXTRA + OP_TYPEPOSPLUS: -
1207 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1208 if (count > 0) { ADD_ACTIVE(state_offset + 4, 0); }
never executed: }
never executed: return (-19);
never evaluated: count > 0
never evaluated: active_count++ < wscount
0
1209 if (clen > 0)
never evaluated: clen > 0
0
1210 { -
1211 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1212 const ucd_record * prop = GET_UCD(c);
never 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]);
-
1213 switch(code[2]) -
1214 { -
1215 case PT_ANY: -
1216 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1217 break;
never executed: break;
0
1218 -
1219 case PT_LAMP: -
1220 OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
never evaluated: prop->chartype == ucp_Lu
never evaluated: prop->chartype == ucp_Ll
0
1221 prop->chartype == ucp_Lt;
never evaluated: prop->chartype == ucp_Lt
0
1222 break;
never executed: break;
0
1223 -
1224 case PT_GC: -
1225 OK = PRIV(ucp_gentype)[prop->chartype] == code[3];
never executed (the execution status of this line is deduced): OK = _pcre16_ucp_gentype[prop->chartype] == code[3];
-
1226 break;
never executed: break;
0
1227 -
1228 case PT_PC: -
1229 OK = prop->chartype == code[3];
never executed (the execution status of this line is deduced): OK = prop->chartype == code[3];
-
1230 break;
never executed: break;
0
1231 -
1232 case PT_SC: -
1233 OK = prop->script == code[3];
never executed (the execution status of this line is deduced): OK = prop->script == code[3];
-
1234 break;
never executed: break;
0
1235 -
1236 /* These are specials for combination cases. */ -
1237 -
1238 case PT_ALNUM: -
1239 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L
0
1240 PRIV(ucp_gentype)[prop->chartype] == ucp_N;
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N
0
1241 break;
never executed: break;
0
1242 -
1243 case PT_SPACE: /* Perl space */ -
1244 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z
0
1245 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
never evaluated: c == '\011'
never evaluated: c == '\012'
never evaluated: c == '\014'
never evaluated: c == '\015'
0
1246 break;
never executed: break;
0
1247 -
1248 case PT_PXSPACE: /* POSIX space */ -
1249 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z
0
1250 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
never evaluated: c == '\011'
never evaluated: c == '\012'
never evaluated: c == '\013'
0
1251 c == CHAR_FF || c == CHAR_CR;
never evaluated: c == '\014'
never evaluated: c == '\015'
0
1252 break;
never executed: break;
0
1253 -
1254 case PT_WORD: -
1255 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L
0
1256 PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N
0
1257 c == CHAR_UNDERSCORE;
never evaluated: c == '\137'
0
1258 break;
never executed: break;
0
1259 -
1260 /* Should never occur, but keep compilers from grumbling. */ -
1261 -
1262 default: -
1263 OK = codevalue != OP_PROP;
never executed (the execution status of this line is deduced): OK = codevalue != OP_PROP;
-
1264 break;
never executed: break;
0
1265 } -
1266 -
1267 if (OK == (d == OP_PROP))
never evaluated: OK == (d == OP_PROP)
0
1268 { -
1269 if (count > 0 && codevalue == OP_PROP_EXTRA + OP_TYPEPOSPLUS)
never evaluated: count > 0
never evaluated: codevalue == 300 + OP_TYPEPOSPLUS
0
1270 { -
1271 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1272 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1273 }
never executed: }
0
1274 count++;
never executed (the execution status of this line is deduced): count++;
-
1275 ADD_NEW(state_offset, count);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1276 } -
1277 }
never executed: }
0
1278 break;
never executed: break;
0
1279 -
1280 /*-----------------------------------------------------------------*/ -
1281 case OP_EXTUNI_EXTRA + OP_TYPEPLUS: -
1282 case OP_EXTUNI_EXTRA + OP_TYPEMINPLUS: -
1283 case OP_EXTUNI_EXTRA + OP_TYPEPOSPLUS: -
1284 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1285 if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); }
never executed: }
never executed: return (-19);
never evaluated: count > 0
never evaluated: active_count++ < wscount
0
1286 if (clen > 0 && UCD_CATEGORY(c) != ucp_M)
never evaluated: clen > 0
never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M
0
1287 { -
1288 const pcre_uchar *nptr = ptr + clen;
never executed (the execution status of this line is deduced): const pcre_uchar *nptr = ptr + clen;
-
1289 int ncount = 0;
never executed (the execution status of this line is deduced): int ncount = 0;
-
1290 if (count > 0 && codevalue == OP_EXTUNI_EXTRA + OP_TYPEPOSPLUS)
never evaluated: count > 0
never evaluated: codevalue == 320 + OP_TYPEPOSPLUS
0
1291 { -
1292 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1293 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1294 }
never executed: }
0
1295 while (nptr < end_subject)
never evaluated: nptr < end_subject
0
1296 { -
1297 int nd;
never executed (the execution status of this line is deduced): int nd;
-
1298 int ndlen = 1;
never executed (the execution status of this line is deduced): int ndlen = 1;
-
1299 GETCHARLEN(nd, nptr, ndlen);
never executed: }
never evaluated: (nd & 0xfc00) == 0xd800
0
1300 if (UCD_CATEGORY(nd) != ucp_M) break;
never executed: break;
never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(nd) / 128] * 128 + (nd) % 128])->chartype] != ucp_M
0
1301 ncount++;
never executed (the execution status of this line is deduced): ncount++;
-
1302 nptr += ndlen;
never executed (the execution status of this line is deduced): nptr += ndlen;
-
1303 }
never executed: }
0
1304 count++;
never executed (the execution status of this line is deduced): count++;
-
1305 ADD_NEW_DATA(-state_offset, count, ncount);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1306 } -
1307 break;
never executed: break;
0
1308#endif -
1309 -
1310 /*-----------------------------------------------------------------*/ -
1311 case OP_ANYNL_EXTRA + OP_TYPEPLUS: -
1312 case OP_ANYNL_EXTRA + OP_TYPEMINPLUS: -
1313 case OP_ANYNL_EXTRA + OP_TYPEPOSPLUS: -
1314 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1315 if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); }
never executed: }
never executed: return (-19);
never evaluated: count > 0
never evaluated: active_count++ < wscount
0
1316 if (clen > 0)
never evaluated: clen > 0
0
1317 { -
1318 int ncount = 0;
never executed (the execution status of this line is deduced): int ncount = 0;
-
1319 switch (c) -
1320 { -
1321 case 0x000b: -
1322 case 0x000c: -
1323 case 0x0085: -
1324 case 0x2028: -
1325 case 0x2029: -
1326 if ((md->moptions & PCRE_BSR_ANYCRLF) != 0) break;
never executed: break;
never evaluated: (md->moptions & 0x00800000) != 0
0
1327 goto ANYNL01;
never executed: goto ANYNL01;
0
1328 -
1329 case 0x000d: -
1330 if (ptr + 1 < end_subject && ptr[1] == 0x0a) ncount = 1;
never executed: ncount = 1;
never evaluated: ptr + 1 < end_subject
never evaluated: ptr[1] == 0x0a
0
1331 /* Fall through */ -
1332 -
1333 ANYNL01:
code before this statement never executed: ANYNL01:
0
1334 case 0x000a: -
1335 if (count > 0 && codevalue == OP_ANYNL_EXTRA + OP_TYPEPOSPLUS)
never evaluated: count > 0
never evaluated: codevalue == 340 + OP_TYPEPOSPLUS
0
1336 { -
1337 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1338 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1339 }
never executed: }
0
1340 count++;
never executed (the execution status of this line is deduced): count++;
-
1341 ADD_NEW_DATA(-state_offset, count, ncount);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1342 break;
never executed: break;
0
1343 -
1344 default: -
1345 break;
never executed: break;
0
1346 } -
1347 }
never executed: }
0
1348 break;
never executed: break;
0
1349 -
1350 /*-----------------------------------------------------------------*/ -
1351 case OP_VSPACE_EXTRA + OP_TYPEPLUS: -
1352 case OP_VSPACE_EXTRA + OP_TYPEMINPLUS: -
1353 case OP_VSPACE_EXTRA + OP_TYPEPOSPLUS: -
1354 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1355 if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); }
never executed: }
never executed: return (-19);
never evaluated: count > 0
never evaluated: active_count++ < wscount
0
1356 if (clen > 0)
never evaluated: clen > 0
0
1357 { -
1358 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1359 switch (c) -
1360 { -
1361 case 0x000a: -
1362 case 0x000b: -
1363 case 0x000c: -
1364 case 0x000d: -
1365 case 0x0085: -
1366 case 0x2028: -
1367 case 0x2029: -
1368 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1369 break;
never executed: break;
0
1370 -
1371 default: -
1372 OK = FALSE;
never executed (the execution status of this line is deduced): OK = 0;
-
1373 break;
never executed: break;
0
1374 } -
1375 -
1376 if (OK == (d == OP_VSPACE))
never evaluated: OK == (d == OP_VSPACE)
0
1377 { -
1378 if (count > 0 && codevalue == OP_VSPACE_EXTRA + OP_TYPEPOSPLUS)
never evaluated: count > 0
never evaluated: codevalue == 380 + OP_TYPEPOSPLUS
0
1379 { -
1380 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1381 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1382 }
never executed: }
0
1383 count++;
never executed (the execution status of this line is deduced): count++;
-
1384 ADD_NEW_DATA(-state_offset, count, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1385 } -
1386 }
never executed: }
0
1387 break;
never executed: break;
0
1388 -
1389 /*-----------------------------------------------------------------*/ -
1390 case OP_HSPACE_EXTRA + OP_TYPEPLUS: -
1391 case OP_HSPACE_EXTRA + OP_TYPEMINPLUS: -
1392 case OP_HSPACE_EXTRA + OP_TYPEPOSPLUS: -
1393 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1394 if (count > 0) { ADD_ACTIVE(state_offset + 2, 0); }
never executed: }
never executed: return (-19);
never evaluated: count > 0
never evaluated: active_count++ < wscount
0
1395 if (clen > 0)
never evaluated: clen > 0
0
1396 { -
1397 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1398 switch (c) -
1399 { -
1400 case 0x09: /* HT */ -
1401 case 0x20: /* SPACE */ -
1402 case 0xa0: /* NBSP */ -
1403 case 0x1680: /* OGHAM SPACE MARK */ -
1404 case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ -
1405 case 0x2000: /* EN QUAD */ -
1406 case 0x2001: /* EM QUAD */ -
1407 case 0x2002: /* EN SPACE */ -
1408 case 0x2003: /* EM SPACE */ -
1409 case 0x2004: /* THREE-PER-EM SPACE */ -
1410 case 0x2005: /* FOUR-PER-EM SPACE */ -
1411 case 0x2006: /* SIX-PER-EM SPACE */ -
1412 case 0x2007: /* FIGURE SPACE */ -
1413 case 0x2008: /* PUNCTUATION SPACE */ -
1414 case 0x2009: /* THIN SPACE */ -
1415 case 0x200A: /* HAIR SPACE */ -
1416 case 0x202f: /* NARROW NO-BREAK SPACE */ -
1417 case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ -
1418 case 0x3000: /* IDEOGRAPHIC SPACE */ -
1419 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1420 break;
never executed: break;
0
1421 -
1422 default: -
1423 OK = FALSE;
never executed (the execution status of this line is deduced): OK = 0;
-
1424 break;
never executed: break;
0
1425 } -
1426 -
1427 if (OK == (d == OP_HSPACE))
never evaluated: OK == (d == OP_HSPACE)
0
1428 { -
1429 if (count > 0 && codevalue == OP_HSPACE_EXTRA + OP_TYPEPOSPLUS)
never evaluated: count > 0
never evaluated: codevalue == 360 + OP_TYPEPOSPLUS
0
1430 { -
1431 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1432 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1433 }
never executed: }
0
1434 count++;
never executed (the execution status of this line is deduced): count++;
-
1435 ADD_NEW_DATA(-state_offset, count, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1436 } -
1437 }
never executed: }
0
1438 break;
never executed: break;
0
1439 -
1440 /*-----------------------------------------------------------------*/ -
1441#ifdef SUPPORT_UCP -
1442 case OP_PROP_EXTRA + OP_TYPEQUERY: -
1443 case OP_PROP_EXTRA + OP_TYPEMINQUERY: -
1444 case OP_PROP_EXTRA + OP_TYPEPOSQUERY: -
1445 count = 4;
never executed (the execution status of this line is deduced): count = 4;
-
1446 goto QS1;
never executed: goto QS1;
0
1447 -
1448 case OP_PROP_EXTRA + OP_TYPESTAR: -
1449 case OP_PROP_EXTRA + OP_TYPEMINSTAR: -
1450 case OP_PROP_EXTRA + OP_TYPEPOSSTAR: -
1451 count = 0;
never executed (the execution status of this line is deduced): count = 0;
-
1452 -
1453 QS1:
code before this statement never executed: QS1:
0
1454 -
1455 ADD_ACTIVE(state_offset + 4, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1456 if (clen > 0)
never evaluated: clen > 0
0
1457 { -
1458 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1459 const ucd_record * prop = GET_UCD(c);
never 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]);
-
1460 switch(code[2]) -
1461 { -
1462 case PT_ANY: -
1463 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1464 break;
never executed: break;
0
1465 -
1466 case PT_LAMP: -
1467 OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
never evaluated: prop->chartype == ucp_Lu
never evaluated: prop->chartype == ucp_Ll
0
1468 prop->chartype == ucp_Lt;
never evaluated: prop->chartype == ucp_Lt
0
1469 break;
never executed: break;
0
1470 -
1471 case PT_GC: -
1472 OK = PRIV(ucp_gentype)[prop->chartype] == code[3];
never executed (the execution status of this line is deduced): OK = _pcre16_ucp_gentype[prop->chartype] == code[3];
-
1473 break;
never executed: break;
0
1474 -
1475 case PT_PC: -
1476 OK = prop->chartype == code[3];
never executed (the execution status of this line is deduced): OK = prop->chartype == code[3];
-
1477 break;
never executed: break;
0
1478 -
1479 case PT_SC: -
1480 OK = prop->script == code[3];
never executed (the execution status of this line is deduced): OK = prop->script == code[3];
-
1481 break;
never executed: break;
0
1482 -
1483 /* These are specials for combination cases. */ -
1484 -
1485 case PT_ALNUM: -
1486 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L
0
1487 PRIV(ucp_gentype)[prop->chartype] == ucp_N;
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N
0
1488 break;
never executed: break;
0
1489 -
1490 case PT_SPACE: /* Perl space */ -
1491 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z
0
1492 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
never evaluated: c == '\011'
never evaluated: c == '\012'
never evaluated: c == '\014'
never evaluated: c == '\015'
0
1493 break;
never executed: break;
0
1494 -
1495 case PT_PXSPACE: /* POSIX space */ -
1496 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z
0
1497 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
never evaluated: c == '\011'
never evaluated: c == '\012'
never evaluated: c == '\013'
0
1498 c == CHAR_FF || c == CHAR_CR;
never evaluated: c == '\014'
never evaluated: c == '\015'
0
1499 break;
never executed: break;
0
1500 -
1501 case PT_WORD: -
1502 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L
0
1503 PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N
0
1504 c == CHAR_UNDERSCORE;
never evaluated: c == '\137'
0
1505 break;
never executed: break;
0
1506 -
1507 /* Should never occur, but keep compilers from grumbling. */ -
1508 -
1509 default: -
1510 OK = codevalue != OP_PROP;
never executed (the execution status of this line is deduced): OK = codevalue != OP_PROP;
-
1511 break;
never executed: break;
0
1512 } -
1513 -
1514 if (OK == (d == OP_PROP))
never evaluated: OK == (d == OP_PROP)
0
1515 { -
1516 if (codevalue == OP_PROP_EXTRA + OP_TYPEPOSSTAR ||
never evaluated: codevalue == 300 + OP_TYPEPOSSTAR
0
1517 codevalue == OP_PROP_EXTRA + OP_TYPEPOSQUERY)
never evaluated: codevalue == 300 + OP_TYPEPOSQUERY
0
1518 { -
1519 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1520 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1521 }
never executed: }
0
1522 ADD_NEW(state_offset + count, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1523 } -
1524 }
never executed: }
0
1525 break;
never executed: break;
0
1526 -
1527 /*-----------------------------------------------------------------*/ -
1528 case OP_EXTUNI_EXTRA + OP_TYPEQUERY: -
1529 case OP_EXTUNI_EXTRA + OP_TYPEMINQUERY: -
1530 case OP_EXTUNI_EXTRA + OP_TYPEPOSQUERY: -
1531 count = 2;
never executed (the execution status of this line is deduced): count = 2;
-
1532 goto QS2;
never executed: goto QS2;
0
1533 -
1534 case OP_EXTUNI_EXTRA + OP_TYPESTAR: -
1535 case OP_EXTUNI_EXTRA + OP_TYPEMINSTAR: -
1536 case OP_EXTUNI_EXTRA + OP_TYPEPOSSTAR: -
1537 count = 0;
never executed (the execution status of this line is deduced): count = 0;
-
1538 -
1539 QS2:
code before this statement never executed: QS2:
0
1540 -
1541 ADD_ACTIVE(state_offset + 2, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1542 if (clen > 0 && UCD_CATEGORY(c) != ucp_M)
never evaluated: clen > 0
never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M
0
1543 { -
1544 const pcre_uchar *nptr = ptr + clen;
never executed (the execution status of this line is deduced): const pcre_uchar *nptr = ptr + clen;
-
1545 int ncount = 0;
never executed (the execution status of this line is deduced): int ncount = 0;
-
1546 if (codevalue == OP_EXTUNI_EXTRA + OP_TYPEPOSSTAR ||
never evaluated: codevalue == 320 + OP_TYPEPOSSTAR
0
1547 codevalue == OP_EXTUNI_EXTRA + OP_TYPEPOSQUERY)
never evaluated: codevalue == 320 + OP_TYPEPOSQUERY
0
1548 { -
1549 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1550 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1551 }
never executed: }
0
1552 while (nptr < end_subject)
never evaluated: nptr < end_subject
0
1553 { -
1554 int nd;
never executed (the execution status of this line is deduced): int nd;
-
1555 int ndlen = 1;
never executed (the execution status of this line is deduced): int ndlen = 1;
-
1556 GETCHARLEN(nd, nptr, ndlen);
never executed: }
never evaluated: (nd & 0xfc00) == 0xd800
0
1557 if (UCD_CATEGORY(nd) != ucp_M) break;
never executed: break;
never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(nd) / 128] * 128 + (nd) % 128])->chartype] != ucp_M
0
1558 ncount++;
never executed (the execution status of this line is deduced): ncount++;
-
1559 nptr += ndlen;
never executed (the execution status of this line is deduced): nptr += ndlen;
-
1560 }
never executed: }
0
1561 ADD_NEW_DATA(-(state_offset + count), 0, ncount);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1562 } -
1563 break;
never executed: break;
0
1564#endif -
1565 -
1566 /*-----------------------------------------------------------------*/ -
1567 case OP_ANYNL_EXTRA + OP_TYPEQUERY: -
1568 case OP_ANYNL_EXTRA + OP_TYPEMINQUERY: -
1569 case OP_ANYNL_EXTRA + OP_TYPEPOSQUERY: -
1570 count = 2;
never executed (the execution status of this line is deduced): count = 2;
-
1571 goto QS3;
never executed: goto QS3;
0
1572 -
1573 case OP_ANYNL_EXTRA + OP_TYPESTAR: -
1574 case OP_ANYNL_EXTRA + OP_TYPEMINSTAR: -
1575 case OP_ANYNL_EXTRA + OP_TYPEPOSSTAR: -
1576 count = 0;
never executed (the execution status of this line is deduced): count = 0;
-
1577 -
1578 QS3:
code before this statement never executed: QS3:
0
1579 ADD_ACTIVE(state_offset + 2, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1580 if (clen > 0)
never evaluated: clen > 0
0
1581 { -
1582 int ncount = 0;
never executed (the execution status of this line is deduced): int ncount = 0;
-
1583 switch (c) -
1584 { -
1585 case 0x000b: -
1586 case 0x000c: -
1587 case 0x0085: -
1588 case 0x2028: -
1589 case 0x2029: -
1590 if ((md->moptions & PCRE_BSR_ANYCRLF) != 0) break;
never executed: break;
never evaluated: (md->moptions & 0x00800000) != 0
0
1591 goto ANYNL02;
never executed: goto ANYNL02;
0
1592 -
1593 case 0x000d: -
1594 if (ptr + 1 < end_subject && ptr[1] == 0x0a) ncount = 1;
never executed: ncount = 1;
never evaluated: ptr + 1 < end_subject
never evaluated: ptr[1] == 0x0a
0
1595 /* Fall through */ -
1596 -
1597 ANYNL02:
code before this statement never executed: ANYNL02:
0
1598 case 0x000a: -
1599 if (codevalue == OP_ANYNL_EXTRA + OP_TYPEPOSSTAR ||
never evaluated: codevalue == 340 + OP_TYPEPOSSTAR
0
1600 codevalue == OP_ANYNL_EXTRA + OP_TYPEPOSQUERY)
never evaluated: codevalue == 340 + OP_TYPEPOSQUERY
0
1601 { -
1602 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1603 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1604 }
never executed: }
0
1605 ADD_NEW_DATA(-(state_offset + count), 0, ncount);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1606 break;
never executed: break;
0
1607 -
1608 default: -
1609 break;
never executed: break;
0
1610 } -
1611 }
never executed: }
0
1612 break;
never executed: break;
0
1613 -
1614 /*-----------------------------------------------------------------*/ -
1615 case OP_VSPACE_EXTRA + OP_TYPEQUERY: -
1616 case OP_VSPACE_EXTRA + OP_TYPEMINQUERY: -
1617 case OP_VSPACE_EXTRA + OP_TYPEPOSQUERY: -
1618 count = 2;
never executed (the execution status of this line is deduced): count = 2;
-
1619 goto QS4;
never executed: goto QS4;
0
1620 -
1621 case OP_VSPACE_EXTRA + OP_TYPESTAR: -
1622 case OP_VSPACE_EXTRA + OP_TYPEMINSTAR: -
1623 case OP_VSPACE_EXTRA + OP_TYPEPOSSTAR: -
1624 count = 0;
never executed (the execution status of this line is deduced): count = 0;
-
1625 -
1626 QS4:
code before this statement never executed: QS4:
0
1627 ADD_ACTIVE(state_offset + 2, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1628 if (clen > 0)
never evaluated: clen > 0
0
1629 { -
1630 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1631 switch (c) -
1632 { -
1633 case 0x000a: -
1634 case 0x000b: -
1635 case 0x000c: -
1636 case 0x000d: -
1637 case 0x0085: -
1638 case 0x2028: -
1639 case 0x2029: -
1640 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1641 break;
never executed: break;
0
1642 -
1643 default: -
1644 OK = FALSE;
never executed (the execution status of this line is deduced): OK = 0;
-
1645 break;
never executed: break;
0
1646 } -
1647 if (OK == (d == OP_VSPACE))
never evaluated: OK == (d == OP_VSPACE)
0
1648 { -
1649 if (codevalue == OP_VSPACE_EXTRA + OP_TYPEPOSSTAR ||
never evaluated: codevalue == 380 + OP_TYPEPOSSTAR
0
1650 codevalue == OP_VSPACE_EXTRA + OP_TYPEPOSQUERY)
never evaluated: codevalue == 380 + OP_TYPEPOSQUERY
0
1651 { -
1652 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1653 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1654 }
never executed: }
0
1655 ADD_NEW_DATA(-(state_offset + count), 0, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1656 } -
1657 }
never executed: }
0
1658 break;
never executed: break;
0
1659 -
1660 /*-----------------------------------------------------------------*/ -
1661 case OP_HSPACE_EXTRA + OP_TYPEQUERY: -
1662 case OP_HSPACE_EXTRA + OP_TYPEMINQUERY: -
1663 case OP_HSPACE_EXTRA + OP_TYPEPOSQUERY: -
1664 count = 2;
never executed (the execution status of this line is deduced): count = 2;
-
1665 goto QS5;
never executed: goto QS5;
0
1666 -
1667 case OP_HSPACE_EXTRA + OP_TYPESTAR: -
1668 case OP_HSPACE_EXTRA + OP_TYPEMINSTAR: -
1669 case OP_HSPACE_EXTRA + OP_TYPEPOSSTAR: -
1670 count = 0;
never executed (the execution status of this line is deduced): count = 0;
-
1671 -
1672 QS5:
code before this statement never executed: QS5:
0
1673 ADD_ACTIVE(state_offset + 2, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1674 if (clen > 0)
never evaluated: clen > 0
0
1675 { -
1676 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1677 switch (c) -
1678 { -
1679 case 0x09: /* HT */ -
1680 case 0x20: /* SPACE */ -
1681 case 0xa0: /* NBSP */ -
1682 case 0x1680: /* OGHAM SPACE MARK */ -
1683 case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ -
1684 case 0x2000: /* EN QUAD */ -
1685 case 0x2001: /* EM QUAD */ -
1686 case 0x2002: /* EN SPACE */ -
1687 case 0x2003: /* EM SPACE */ -
1688 case 0x2004: /* THREE-PER-EM SPACE */ -
1689 case 0x2005: /* FOUR-PER-EM SPACE */ -
1690 case 0x2006: /* SIX-PER-EM SPACE */ -
1691 case 0x2007: /* FIGURE SPACE */ -
1692 case 0x2008: /* PUNCTUATION SPACE */ -
1693 case 0x2009: /* THIN SPACE */ -
1694 case 0x200A: /* HAIR SPACE */ -
1695 case 0x202f: /* NARROW NO-BREAK SPACE */ -
1696 case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ -
1697 case 0x3000: /* IDEOGRAPHIC SPACE */ -
1698 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1699 break;
never executed: break;
0
1700 -
1701 default: -
1702 OK = FALSE;
never executed (the execution status of this line is deduced): OK = 0;
-
1703 break;
never executed: break;
0
1704 } -
1705 -
1706 if (OK == (d == OP_HSPACE))
never evaluated: OK == (d == OP_HSPACE)
0
1707 { -
1708 if (codevalue == OP_HSPACE_EXTRA + OP_TYPEPOSSTAR ||
never evaluated: codevalue == 360 + OP_TYPEPOSSTAR
0
1709 codevalue == OP_HSPACE_EXTRA + OP_TYPEPOSQUERY)
never evaluated: codevalue == 360 + OP_TYPEPOSQUERY
0
1710 { -
1711 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1712 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1713 }
never executed: }
0
1714 ADD_NEW_DATA(-(state_offset + count), 0, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1715 } -
1716 }
never executed: }
0
1717 break;
never executed: break;
0
1718 -
1719 /*-----------------------------------------------------------------*/ -
1720#ifdef SUPPORT_UCP -
1721 case OP_PROP_EXTRA + OP_TYPEEXACT: -
1722 case OP_PROP_EXTRA + OP_TYPEUPTO: -
1723 case OP_PROP_EXTRA + OP_TYPEMINUPTO: -
1724 case OP_PROP_EXTRA + OP_TYPEPOSUPTO: -
1725 if (codevalue != OP_PROP_EXTRA + OP_TYPEEXACT)
never evaluated: codevalue != 300 + OP_TYPEEXACT
0
1726 { ADD_ACTIVE(state_offset + 1 + IMM2_SIZE + 3, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1727 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1728 if (clen > 0)
never evaluated: clen > 0
0
1729 { -
1730 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1731 const ucd_record * prop = GET_UCD(c);
never 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]);
-
1732 switch(code[1 + IMM2_SIZE + 1]) -
1733 { -
1734 case PT_ANY: -
1735 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1736 break;
never executed: break;
0
1737 -
1738 case PT_LAMP: -
1739 OK = prop->chartype == ucp_Lu || prop->chartype == ucp_Ll ||
never evaluated: prop->chartype == ucp_Lu
never evaluated: prop->chartype == ucp_Ll
0
1740 prop->chartype == ucp_Lt;
never evaluated: prop->chartype == ucp_Lt
0
1741 break;
never executed: break;
0
1742 -
1743 case PT_GC: -
1744 OK = PRIV(ucp_gentype)[prop->chartype] == code[1 + IMM2_SIZE + 2];
never executed (the execution status of this line is deduced): OK = _pcre16_ucp_gentype[prop->chartype] == code[1 + 1 + 2];
-
1745 break;
never executed: break;
0
1746 -
1747 case PT_PC: -
1748 OK = prop->chartype == code[1 + IMM2_SIZE + 2];
never executed (the execution status of this line is deduced): OK = prop->chartype == code[1 + 1 + 2];
-
1749 break;
never executed: break;
0
1750 -
1751 case PT_SC: -
1752 OK = prop->script == code[1 + IMM2_SIZE + 2];
never executed (the execution status of this line is deduced): OK = prop->script == code[1 + 1 + 2];
-
1753 break;
never executed: break;
0
1754 -
1755 /* These are specials for combination cases. */ -
1756 -
1757 case PT_ALNUM: -
1758 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L
0
1759 PRIV(ucp_gentype)[prop->chartype] == ucp_N;
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N
0
1760 break;
never executed: break;
0
1761 -
1762 case PT_SPACE: /* Perl space */ -
1763 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z
0
1764 c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR;
never evaluated: c == '\011'
never evaluated: c == '\012'
never evaluated: c == '\014'
never evaluated: c == '\015'
0
1765 break;
never executed: break;
0
1766 -
1767 case PT_PXSPACE: /* POSIX space */ -
1768 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_Z
0
1769 c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
never evaluated: c == '\011'
never evaluated: c == '\012'
never evaluated: c == '\013'
0
1770 c == CHAR_FF || c == CHAR_CR;
never evaluated: c == '\014'
never evaluated: c == '\015'
0
1771 break;
never executed: break;
0
1772 -
1773 case PT_WORD: -
1774 OK = PRIV(ucp_gentype)[prop->chartype] == ucp_L ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_L
0
1775 PRIV(ucp_gentype)[prop->chartype] == ucp_N ||
never evaluated: _pcre16_ucp_gentype[prop->chartype] == ucp_N
0
1776 c == CHAR_UNDERSCORE;
never evaluated: c == '\137'
0
1777 break;
never executed: break;
0
1778 -
1779 /* Should never occur, but keep compilers from grumbling. */ -
1780 -
1781 default: -
1782 OK = codevalue != OP_PROP;
never executed (the execution status of this line is deduced): OK = codevalue != OP_PROP;
-
1783 break;
never executed: break;
0
1784 } -
1785 -
1786 if (OK == (d == OP_PROP))
never evaluated: OK == (d == OP_PROP)
0
1787 { -
1788 if (codevalue == OP_PROP_EXTRA + OP_TYPEPOSUPTO)
never evaluated: codevalue == 300 + OP_TYPEPOSUPTO
0
1789 { -
1790 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1791 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1792 }
never executed: }
0
1793 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
1794 { ADD_NEW(state_offset + 1 + IMM2_SIZE + 3, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1795 else -
1796 { ADD_NEW(state_offset, count); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1797 } -
1798 }
never executed: }
0
1799 break;
never executed: break;
0
1800 -
1801 /*-----------------------------------------------------------------*/ -
1802 case OP_EXTUNI_EXTRA + OP_TYPEEXACT: -
1803 case OP_EXTUNI_EXTRA + OP_TYPEUPTO: -
1804 case OP_EXTUNI_EXTRA + OP_TYPEMINUPTO: -
1805 case OP_EXTUNI_EXTRA + OP_TYPEPOSUPTO: -
1806 if (codevalue != OP_EXTUNI_EXTRA + OP_TYPEEXACT)
never evaluated: codevalue != 320 + OP_TYPEEXACT
0
1807 { ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1808 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1809 if (clen > 0 && UCD_CATEGORY(c) != ucp_M)
never evaluated: clen > 0
never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M
0
1810 { -
1811 const pcre_uchar *nptr = ptr + clen;
never executed (the execution status of this line is deduced): const pcre_uchar *nptr = ptr + clen;
-
1812 int ncount = 0;
never executed (the execution status of this line is deduced): int ncount = 0;
-
1813 if (codevalue == OP_EXTUNI_EXTRA + OP_TYPEPOSUPTO)
never evaluated: codevalue == 320 + OP_TYPEPOSUPTO
0
1814 { -
1815 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1816 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1817 }
never executed: }
0
1818 while (nptr < end_subject)
never evaluated: nptr < end_subject
0
1819 { -
1820 int nd;
never executed (the execution status of this line is deduced): int nd;
-
1821 int ndlen = 1;
never executed (the execution status of this line is deduced): int ndlen = 1;
-
1822 GETCHARLEN(nd, nptr, ndlen);
never executed: }
never evaluated: (nd & 0xfc00) == 0xd800
0
1823 if (UCD_CATEGORY(nd) != ucp_M) break;
never executed: break;
never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(nd) / 128] * 128 + (nd) % 128])->chartype] != ucp_M
0
1824 ncount++;
never executed (the execution status of this line is deduced): ncount++;
-
1825 nptr += ndlen;
never executed (the execution status of this line is deduced): nptr += ndlen;
-
1826 }
never executed: }
0
1827 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
1828 { ADD_NEW_DATA(-(state_offset + 2 + IMM2_SIZE), 0, ncount); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1829 else -
1830 { ADD_NEW_DATA(-state_offset, count, ncount); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1831 } -
1832 break;
never executed: break;
0
1833#endif -
1834 -
1835 /*-----------------------------------------------------------------*/ -
1836 case OP_ANYNL_EXTRA + OP_TYPEEXACT: -
1837 case OP_ANYNL_EXTRA + OP_TYPEUPTO: -
1838 case OP_ANYNL_EXTRA + OP_TYPEMINUPTO: -
1839 case OP_ANYNL_EXTRA + OP_TYPEPOSUPTO: -
1840 if (codevalue != OP_ANYNL_EXTRA + OP_TYPEEXACT)
never evaluated: codevalue != 340 + OP_TYPEEXACT
0
1841 { ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1842 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1843 if (clen > 0)
never evaluated: clen > 0
0
1844 { -
1845 int ncount = 0;
never executed (the execution status of this line is deduced): int ncount = 0;
-
1846 switch (c) -
1847 { -
1848 case 0x000b: -
1849 case 0x000c: -
1850 case 0x0085: -
1851 case 0x2028: -
1852 case 0x2029: -
1853 if ((md->moptions & PCRE_BSR_ANYCRLF) != 0) break;
never executed: break;
never evaluated: (md->moptions & 0x00800000) != 0
0
1854 goto ANYNL03;
never executed: goto ANYNL03;
0
1855 -
1856 case 0x000d: -
1857 if (ptr + 1 < end_subject && ptr[1] == 0x0a) ncount = 1;
never executed: ncount = 1;
never evaluated: ptr + 1 < end_subject
never evaluated: ptr[1] == 0x0a
0
1858 /* Fall through */ -
1859 -
1860 ANYNL03:
code before this statement never executed: ANYNL03:
0
1861 case 0x000a: -
1862 if (codevalue == OP_ANYNL_EXTRA + OP_TYPEPOSUPTO)
never evaluated: codevalue == 340 + OP_TYPEPOSUPTO
0
1863 { -
1864 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1865 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1866 }
never executed: }
0
1867 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
1868 { ADD_NEW_DATA(-(state_offset + 2 + IMM2_SIZE), 0, ncount); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1869 else -
1870 { ADD_NEW_DATA(-state_offset, count, ncount); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1871 break;
never executed: break;
0
1872 -
1873 default: -
1874 break;
never executed: break;
0
1875 } -
1876 }
never executed: }
0
1877 break;
never executed: break;
0
1878 -
1879 /*-----------------------------------------------------------------*/ -
1880 case OP_VSPACE_EXTRA + OP_TYPEEXACT: -
1881 case OP_VSPACE_EXTRA + OP_TYPEUPTO: -
1882 case OP_VSPACE_EXTRA + OP_TYPEMINUPTO: -
1883 case OP_VSPACE_EXTRA + OP_TYPEPOSUPTO: -
1884 if (codevalue != OP_VSPACE_EXTRA + OP_TYPEEXACT)
never evaluated: codevalue != 380 + OP_TYPEEXACT
0
1885 { ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1886 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1887 if (clen > 0)
never evaluated: clen > 0
0
1888 { -
1889 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1890 switch (c) -
1891 { -
1892 case 0x000a: -
1893 case 0x000b: -
1894 case 0x000c: -
1895 case 0x000d: -
1896 case 0x0085: -
1897 case 0x2028: -
1898 case 0x2029: -
1899 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1900 break;
never executed: break;
0
1901 -
1902 default: -
1903 OK = FALSE;
never executed (the execution status of this line is deduced): OK = 0;
-
1904 }
never executed: }
0
1905 -
1906 if (OK == (d == OP_VSPACE))
never evaluated: OK == (d == OP_VSPACE)
0
1907 { -
1908 if (codevalue == OP_VSPACE_EXTRA + OP_TYPEPOSUPTO)
never evaluated: codevalue == 380 + OP_TYPEPOSUPTO
0
1909 { -
1910 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1911 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1912 }
never executed: }
0
1913 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
1914 { ADD_NEW_DATA(-(state_offset + 2 + IMM2_SIZE), 0, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1915 else -
1916 { ADD_NEW_DATA(-state_offset, count, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1917 } -
1918 }
never executed: }
0
1919 break;
never executed: break;
0
1920 -
1921 /*-----------------------------------------------------------------*/ -
1922 case OP_HSPACE_EXTRA + OP_TYPEEXACT: -
1923 case OP_HSPACE_EXTRA + OP_TYPEUPTO: -
1924 case OP_HSPACE_EXTRA + OP_TYPEMINUPTO: -
1925 case OP_HSPACE_EXTRA + OP_TYPEPOSUPTO: -
1926 if (codevalue != OP_HSPACE_EXTRA + OP_TYPEEXACT)
never evaluated: codevalue != 360 + OP_TYPEEXACT
0
1927 { ADD_ACTIVE(state_offset + 2 + IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
1928 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
1929 if (clen > 0)
never evaluated: clen > 0
0
1930 { -
1931 BOOL OK;
never executed (the execution status of this line is deduced): BOOL OK;
-
1932 switch (c) -
1933 { -
1934 case 0x09: /* HT */ -
1935 case 0x20: /* SPACE */ -
1936 case 0xa0: /* NBSP */ -
1937 case 0x1680: /* OGHAM SPACE MARK */ -
1938 case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ -
1939 case 0x2000: /* EN QUAD */ -
1940 case 0x2001: /* EM QUAD */ -
1941 case 0x2002: /* EN SPACE */ -
1942 case 0x2003: /* EM SPACE */ -
1943 case 0x2004: /* THREE-PER-EM SPACE */ -
1944 case 0x2005: /* FOUR-PER-EM SPACE */ -
1945 case 0x2006: /* SIX-PER-EM SPACE */ -
1946 case 0x2007: /* FIGURE SPACE */ -
1947 case 0x2008: /* PUNCTUATION SPACE */ -
1948 case 0x2009: /* THIN SPACE */ -
1949 case 0x200A: /* HAIR SPACE */ -
1950 case 0x202f: /* NARROW NO-BREAK SPACE */ -
1951 case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ -
1952 case 0x3000: /* IDEOGRAPHIC SPACE */ -
1953 OK = TRUE;
never executed (the execution status of this line is deduced): OK = 1;
-
1954 break;
never executed: break;
0
1955 -
1956 default: -
1957 OK = FALSE;
never executed (the execution status of this line is deduced): OK = 0;
-
1958 break;
never executed: break;
0
1959 } -
1960 -
1961 if (OK == (d == OP_HSPACE))
never evaluated: OK == (d == OP_HSPACE)
0
1962 { -
1963 if (codevalue == OP_HSPACE_EXTRA + OP_TYPEPOSUPTO)
never evaluated: codevalue == 360 + OP_TYPEPOSUPTO
0
1964 { -
1965 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
1966 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
1967 }
never executed: }
0
1968 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
1969 { ADD_NEW_DATA(-(state_offset + 2 + IMM2_SIZE), 0, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1970 else -
1971 { ADD_NEW_DATA(-state_offset, count, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
1972 } -
1973 }
never executed: }
0
1974 break;
never executed: break;
0
1975 -
1976/* ========================================================================== */ -
1977 /* These opcodes are followed by a character that is usually compared -
1978 to the current subject character; it is loaded into d. We still get -
1979 here even if there is no subject character, because in some cases zero -
1980 repetitions are permitted. */ -
1981 -
1982 /*-----------------------------------------------------------------*/ -
1983 case OP_CHAR: -
1984 if (clen > 0 && c == d) { ADD_NEW(state_offset + dlen + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
never evaluated: clen > 0
never evaluated: c == d
0
1985 break;
never executed: break;
0
1986 -
1987 /*-----------------------------------------------------------------*/ -
1988 case OP_CHARI: -
1989 if (clen == 0) break;
never executed: break;
never evaluated: clen == 0
0
1990 -
1991#ifdef SUPPORT_UTF -
1992 if (utf)
never evaluated: utf
0
1993 { -
1994 if (c == d) { ADD_NEW(state_offset + dlen + 1, 0); } else
never executed: }
never executed: return (-19);
never evaluated: c == d
never evaluated: new_count++ < wscount
0
1995 { -
1996 unsigned int othercase;
never executed (the execution status of this line is deduced): unsigned int othercase;
-
1997 if (c < 128)
never evaluated: c < 128
0
1998 othercase = fcc[c];
never executed: othercase = fcc[c];
0
1999 else -
2000 /* If we have Unicode property support, we can use it to test the -
2001 other case of the character. */ -
2002#ifdef SUPPORT_UCP -
2003 othercase = UCD_OTHERCASE(c);
never executed: othercase = (c + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->other_case);
0
2004#else -
2005 othercase = NOTACHAR; -
2006#endif -
2007 -
2008 if (d == othercase) { ADD_NEW(state_offset + dlen + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: d == othercase
never evaluated: new_count++ < wscount
0
2009 }
never executed: }
0
2010 } -
2011 else -
2012#endif /* SUPPORT_UTF */ -
2013 /* Not UTF mode */ -
2014 { -
2015 if (TABLE_GET(c, lcc, c) == TABLE_GET(d, lcc, d))
never evaluated: (((c) <= 255u)? ((lcc)[c]):(c)) == (((d) <= 255u)? ((lcc)[d]):(d))
never evaluated: ((c) <= 255u)
never evaluated: ((d) <= 255u)
0
2016 { ADD_NEW(state_offset + 2, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2017 }
never executed: }
0
2018 break;
never executed: break;
0
2019 -
2020 -
2021#ifdef SUPPORT_UCP -
2022 /*-----------------------------------------------------------------*/ -
2023 /* This is a tricky one because it can match more than one character. -
2024 Find out how many characters to skip, and then set up a negative state -
2025 to wait for them to pass before continuing. */ -
2026 -
2027 case OP_EXTUNI: -
2028 if (clen > 0 && UCD_CATEGORY(c) != ucp_M)
never evaluated: clen > 0
never evaluated: _pcre16_ucp_gentype[(_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(c) / 128] * 128 + (c) % 128])->chartype] != ucp_M
0
2029 { -
2030 const pcre_uchar *nptr = ptr + clen;
never executed (the execution status of this line is deduced): const pcre_uchar *nptr = ptr + clen;
-
2031 int ncount = 0;
never executed (the execution status of this line is deduced): int ncount = 0;
-
2032 while (nptr < end_subject)
never evaluated: nptr < end_subject
0
2033 { -
2034 int nclen = 1;
never executed (the execution status of this line is deduced): int nclen = 1;
-
2035 GETCHARLEN(c, nptr, nclen);
never executed: }
never evaluated: (c & 0xfc00) == 0xd800
0
2036 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
2037 ncount++;
never executed (the execution status of this line is deduced): ncount++;
-
2038 nptr += nclen;
never executed (the execution status of this line is deduced): nptr += nclen;
-
2039 }
never executed: }
0
2040 ADD_NEW_DATA(-(state_offset + 1), 0, ncount);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2041 } -
2042 break;
never executed: break;
0
2043#endif -
2044 -
2045 /*-----------------------------------------------------------------*/ -
2046 /* This is a tricky like EXTUNI because it too can match more than one -
2047 character (when CR is followed by LF). In this case, set up a negative -
2048 state to wait for one character to pass before continuing. */ -
2049 -
2050 case OP_ANYNL: -
2051 if (clen > 0) switch(c)
never evaluated: clen > 0
0
2052 { -
2053 case 0x000b: -
2054 case 0x000c: -
2055 case 0x0085: -
2056 case 0x2028: -
2057 case 0x2029: -
2058 if ((md->moptions & PCRE_BSR_ANYCRLF) != 0) break;
never executed: break;
never evaluated: (md->moptions & 0x00800000) != 0
0
2059 -
2060 case 0x000a:
code before this statement never executed: case 0x000a:
0
2061 ADD_NEW(state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2062 break;
never executed: break;
0
2063 -
2064 case 0x000d: -
2065 if (ptr + 1 < end_subject && ptr[1] == 0x0a)
never evaluated: ptr + 1 < end_subject
never evaluated: ptr[1] == 0x0a
0
2066 { -
2067 ADD_NEW_DATA(-(state_offset + 1), 0, 1);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2068 } -
2069 else -
2070 { -
2071 ADD_NEW(state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2072 } -
2073 break;
never executed: break;
0
2074 }
never executed: }
0
2075 break;
never executed: break;
0
2076 -
2077 /*-----------------------------------------------------------------*/ -
2078 case OP_NOT_VSPACE: -
2079 if (clen > 0) switch(c)
never evaluated: clen > 0
0
2080 { -
2081 case 0x000a: -
2082 case 0x000b: -
2083 case 0x000c: -
2084 case 0x000d: -
2085 case 0x0085: -
2086 case 0x2028: -
2087 case 0x2029: -
2088 break;
never executed: break;
0
2089 -
2090 default: -
2091 ADD_NEW(state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2092 break;
never executed: break;
0
2093 }
never executed: }
0
2094 break;
never executed: break;
0
2095 -
2096 /*-----------------------------------------------------------------*/ -
2097 case OP_VSPACE: -
2098 if (clen > 0) switch(c)
never evaluated: clen > 0
0
2099 { -
2100 case 0x000a: -
2101 case 0x000b: -
2102 case 0x000c: -
2103 case 0x000d: -
2104 case 0x0085: -
2105 case 0x2028: -
2106 case 0x2029: -
2107 ADD_NEW(state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2108 break;
never executed: break;
0
2109 -
2110 default: break;
never executed: break;
0
2111 }
never executed: }
0
2112 break;
never executed: break;
0
2113 -
2114 /*-----------------------------------------------------------------*/ -
2115 case OP_NOT_HSPACE: -
2116 if (clen > 0) switch(c)
never evaluated: clen > 0
0
2117 { -
2118 case 0x09: /* HT */ -
2119 case 0x20: /* SPACE */ -
2120 case 0xa0: /* NBSP */ -
2121 case 0x1680: /* OGHAM SPACE MARK */ -
2122 case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ -
2123 case 0x2000: /* EN QUAD */ -
2124 case 0x2001: /* EM QUAD */ -
2125 case 0x2002: /* EN SPACE */ -
2126 case 0x2003: /* EM SPACE */ -
2127 case 0x2004: /* THREE-PER-EM SPACE */ -
2128 case 0x2005: /* FOUR-PER-EM SPACE */ -
2129 case 0x2006: /* SIX-PER-EM SPACE */ -
2130 case 0x2007: /* FIGURE SPACE */ -
2131 case 0x2008: /* PUNCTUATION SPACE */ -
2132 case 0x2009: /* THIN SPACE */ -
2133 case 0x200A: /* HAIR SPACE */ -
2134 case 0x202f: /* NARROW NO-BREAK SPACE */ -
2135 case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ -
2136 case 0x3000: /* IDEOGRAPHIC SPACE */ -
2137 break;
never executed: break;
0
2138 -
2139 default: -
2140 ADD_NEW(state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2141 break;
never executed: break;
0
2142 }
never executed: }
0
2143 break;
never executed: break;
0
2144 -
2145 /*-----------------------------------------------------------------*/ -
2146 case OP_HSPACE: -
2147 if (clen > 0) switch(c)
never evaluated: clen > 0
0
2148 { -
2149 case 0x09: /* HT */ -
2150 case 0x20: /* SPACE */ -
2151 case 0xa0: /* NBSP */ -
2152 case 0x1680: /* OGHAM SPACE MARK */ -
2153 case 0x180e: /* MONGOLIAN VOWEL SEPARATOR */ -
2154 case 0x2000: /* EN QUAD */ -
2155 case 0x2001: /* EM QUAD */ -
2156 case 0x2002: /* EN SPACE */ -
2157 case 0x2003: /* EM SPACE */ -
2158 case 0x2004: /* THREE-PER-EM SPACE */ -
2159 case 0x2005: /* FOUR-PER-EM SPACE */ -
2160 case 0x2006: /* SIX-PER-EM SPACE */ -
2161 case 0x2007: /* FIGURE SPACE */ -
2162 case 0x2008: /* PUNCTUATION SPACE */ -
2163 case 0x2009: /* THIN SPACE */ -
2164 case 0x200A: /* HAIR SPACE */ -
2165 case 0x202f: /* NARROW NO-BREAK SPACE */ -
2166 case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ -
2167 case 0x3000: /* IDEOGRAPHIC SPACE */ -
2168 ADD_NEW(state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2169 break;
never executed: break;
0
2170 }
never executed: }
0
2171 break;
never executed: break;
0
2172 -
2173 /*-----------------------------------------------------------------*/ -
2174 /* Match a negated single character casefully. This is only used for -
2175 one-byte characters, that is, we know that d < 256. The character we are -
2176 checking (c) can be multibyte. */ -
2177 -
2178 case OP_NOT: -
2179 if (clen > 0 && c != d) { ADD_NEW(state_offset + dlen + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
never evaluated: clen > 0
never evaluated: c != d
0
2180 break;
never executed: break;
0
2181 -
2182 /*-----------------------------------------------------------------*/ -
2183 /* Match a negated single character caselessly. This is only used for -
2184 one-byte characters, that is, we know that d < 256. The character we are -
2185 checking (c) can be multibyte. */ -
2186 -
2187 case OP_NOTI: -
2188 if (clen > 0 && c != d && c != fcc[d])
never evaluated: clen > 0
never evaluated: c != d
never evaluated: c != fcc[d]
0
2189 { ADD_NEW(state_offset + dlen + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2190 break;
never executed: break;
0
2191 -
2192 /*-----------------------------------------------------------------*/ -
2193 case OP_PLUSI: -
2194 case OP_MINPLUSI: -
2195 case OP_POSPLUSI: -
2196 case OP_NOTPLUSI: -
2197 case OP_NOTMINPLUSI: -
2198 case OP_NOTPOSPLUSI: -
2199 caseless = TRUE;
never executed (the execution status of this line is deduced): caseless = 1;
-
2200 codevalue -= OP_STARI - OP_STAR;
never executed (the execution status of this line is deduced): codevalue -= OP_STARI - OP_STAR;
-
2201 -
2202 /* Fall through */ -
2203 case OP_PLUS:
code before this statement never executed: case OP_PLUS:
0
2204 case OP_MINPLUS: -
2205 case OP_POSPLUS: -
2206 case OP_NOTPLUS: -
2207 case OP_NOTMINPLUS: -
2208 case OP_NOTPOSPLUS: -
2209 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
2210 if (count > 0) { ADD_ACTIVE(state_offset + dlen + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: count > 0
never evaluated: active_count++ < wscount
0
2211 if (clen > 0)
never evaluated: clen > 0
0
2212 { -
2213 unsigned int otherd = NOTACHAR;
never executed (the execution status of this line is deduced): unsigned int otherd = 0xffffffff;
-
2214 if (caseless)
never evaluated: caseless
0
2215 { -
2216#ifdef SUPPORT_UTF -
2217 if (utf && d >= 128)
never evaluated: utf
never evaluated: d >= 128
0
2218 { -
2219#ifdef SUPPORT_UCP -
2220 otherd = UCD_OTHERCASE(d);
never executed (the execution status of this line is deduced): otherd = (d + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(d) / 128] * 128 + (d) % 128])->other_case);
-
2221#endif /* SUPPORT_UCP */ -
2222 }
never executed: }
0
2223 else -
2224#endif /* SUPPORT_UTF */ -
2225 otherd = TABLE_GET(d, fcc, d);
never executed: otherd = (((d) <= 255u)? ((fcc)[d]):(d));
never evaluated: ((d) <= 255u)
0
2226 } -
2227 if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))
never evaluated: (c == d || c == otherd) == (codevalue < OP_NOTSTAR)
never evaluated: c == d
never evaluated: c == otherd
0
2228 { -
2229 if (count > 0 &&
never evaluated: count > 0
0
2230 (codevalue == OP_POSPLUS || codevalue == OP_NOTPOSPLUS))
never evaluated: codevalue == OP_POSPLUS
never evaluated: codevalue == OP_NOTPOSPLUS
0
2231 { -
2232 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
2233 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
2234 }
never executed: }
0
2235 count++;
never executed (the execution status of this line is deduced): count++;
-
2236 ADD_NEW(state_offset, count);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2237 } -
2238 }
never executed: }
0
2239 break;
never executed: break;
0
2240 -
2241 /*-----------------------------------------------------------------*/ -
2242 case OP_QUERYI: -
2243 case OP_MINQUERYI: -
2244 case OP_POSQUERYI: -
2245 case OP_NOTQUERYI: -
2246 case OP_NOTMINQUERYI: -
2247 case OP_NOTPOSQUERYI: -
2248 caseless = TRUE;
never executed (the execution status of this line is deduced): caseless = 1;
-
2249 codevalue -= OP_STARI - OP_STAR;
never executed (the execution status of this line is deduced): codevalue -= OP_STARI - OP_STAR;
-
2250 /* Fall through */ -
2251 case OP_QUERY:
code before this statement never executed: case OP_QUERY:
0
2252 case OP_MINQUERY: -
2253 case OP_POSQUERY: -
2254 case OP_NOTQUERY: -
2255 case OP_NOTMINQUERY: -
2256 case OP_NOTPOSQUERY: -
2257 ADD_ACTIVE(state_offset + dlen + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2258 if (clen > 0)
never evaluated: clen > 0
0
2259 { -
2260 unsigned int otherd = NOTACHAR;
never executed (the execution status of this line is deduced): unsigned int otherd = 0xffffffff;
-
2261 if (caseless)
never evaluated: caseless
0
2262 { -
2263#ifdef SUPPORT_UTF -
2264 if (utf && d >= 128)
never evaluated: utf
never evaluated: d >= 128
0
2265 { -
2266#ifdef SUPPORT_UCP -
2267 otherd = UCD_OTHERCASE(d);
never executed (the execution status of this line is deduced): otherd = (d + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(d) / 128] * 128 + (d) % 128])->other_case);
-
2268#endif /* SUPPORT_UCP */ -
2269 }
never executed: }
0
2270 else -
2271#endif /* SUPPORT_UTF */ -
2272 otherd = TABLE_GET(d, fcc, d);
never executed: otherd = (((d) <= 255u)? ((fcc)[d]):(d));
never evaluated: ((d) <= 255u)
0
2273 } -
2274 if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))
never evaluated: (c == d || c == otherd) == (codevalue < OP_NOTSTAR)
never evaluated: c == d
never evaluated: c == otherd
0
2275 { -
2276 if (codevalue == OP_POSQUERY || codevalue == OP_NOTPOSQUERY)
never evaluated: codevalue == OP_POSQUERY
never evaluated: codevalue == OP_NOTPOSQUERY
0
2277 { -
2278 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
2279 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
2280 }
never executed: }
0
2281 ADD_NEW(state_offset + dlen + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2282 } -
2283 }
never executed: }
0
2284 break;
never executed: break;
0
2285 -
2286 /*-----------------------------------------------------------------*/ -
2287 case OP_STARI: -
2288 case OP_MINSTARI: -
2289 case OP_POSSTARI: -
2290 case OP_NOTSTARI: -
2291 case OP_NOTMINSTARI: -
2292 case OP_NOTPOSSTARI: -
2293 caseless = TRUE;
never executed (the execution status of this line is deduced): caseless = 1;
-
2294 codevalue -= OP_STARI - OP_STAR;
never executed (the execution status of this line is deduced): codevalue -= OP_STARI - OP_STAR;
-
2295 /* Fall through */ -
2296 case OP_STAR:
code before this statement never executed: case OP_STAR:
0
2297 case OP_MINSTAR: -
2298 case OP_POSSTAR: -
2299 case OP_NOTSTAR: -
2300 case OP_NOTMINSTAR: -
2301 case OP_NOTPOSSTAR: -
2302 ADD_ACTIVE(state_offset + dlen + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2303 if (clen > 0)
never evaluated: clen > 0
0
2304 { -
2305 unsigned int otherd = NOTACHAR;
never executed (the execution status of this line is deduced): unsigned int otherd = 0xffffffff;
-
2306 if (caseless)
never evaluated: caseless
0
2307 { -
2308#ifdef SUPPORT_UTF -
2309 if (utf && d >= 128)
never evaluated: utf
never evaluated: d >= 128
0
2310 { -
2311#ifdef SUPPORT_UCP -
2312 otherd = UCD_OTHERCASE(d);
never executed (the execution status of this line is deduced): otherd = (d + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(d) / 128] * 128 + (d) % 128])->other_case);
-
2313#endif /* SUPPORT_UCP */ -
2314 }
never executed: }
0
2315 else -
2316#endif /* SUPPORT_UTF */ -
2317 otherd = TABLE_GET(d, fcc, d);
never executed: otherd = (((d) <= 255u)? ((fcc)[d]):(d));
never evaluated: ((d) <= 255u)
0
2318 } -
2319 if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))
never evaluated: (c == d || c == otherd) == (codevalue < OP_NOTSTAR)
never evaluated: c == d
never evaluated: c == otherd
0
2320 { -
2321 if (codevalue == OP_POSSTAR || codevalue == OP_NOTPOSSTAR)
never evaluated: codevalue == OP_POSSTAR
never evaluated: codevalue == OP_NOTPOSSTAR
0
2322 { -
2323 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
2324 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
2325 }
never executed: }
0
2326 ADD_NEW(state_offset, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2327 } -
2328 }
never executed: }
0
2329 break;
never executed: break;
0
2330 -
2331 /*-----------------------------------------------------------------*/ -
2332 case OP_EXACTI: -
2333 case OP_NOTEXACTI: -
2334 caseless = TRUE;
never executed (the execution status of this line is deduced): caseless = 1;
-
2335 codevalue -= OP_STARI - OP_STAR;
never executed (the execution status of this line is deduced): codevalue -= OP_STARI - OP_STAR;
-
2336 /* Fall through */ -
2337 case OP_EXACT:
code before this statement never executed: case OP_EXACT:
0
2338 case OP_NOTEXACT: -
2339 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
2340 if (clen > 0)
never evaluated: clen > 0
0
2341 { -
2342 unsigned int otherd = NOTACHAR;
never executed (the execution status of this line is deduced): unsigned int otherd = 0xffffffff;
-
2343 if (caseless)
never evaluated: caseless
0
2344 { -
2345#ifdef SUPPORT_UTF -
2346 if (utf && d >= 128)
never evaluated: utf
never evaluated: d >= 128
0
2347 { -
2348#ifdef SUPPORT_UCP -
2349 otherd = UCD_OTHERCASE(d);
never executed (the execution status of this line is deduced): otherd = (d + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(d) / 128] * 128 + (d) % 128])->other_case);
-
2350#endif /* SUPPORT_UCP */ -
2351 }
never executed: }
0
2352 else -
2353#endif /* SUPPORT_UTF */ -
2354 otherd = TABLE_GET(d, fcc, d);
never executed: otherd = (((d) <= 255u)? ((fcc)[d]):(d));
never evaluated: ((d) <= 255u)
0
2355 } -
2356 if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))
never evaluated: (c == d || c == otherd) == (codevalue < OP_NOTSTAR)
never evaluated: c == d
never evaluated: c == otherd
0
2357 { -
2358 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
2359 { ADD_NEW(state_offset + dlen + 1 + IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2360 else -
2361 { ADD_NEW(state_offset, count); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2362 } -
2363 }
never executed: }
0
2364 break;
never executed: break;
0
2365 -
2366 /*-----------------------------------------------------------------*/ -
2367 case OP_UPTOI: -
2368 case OP_MINUPTOI: -
2369 case OP_POSUPTOI: -
2370 case OP_NOTUPTOI: -
2371 case OP_NOTMINUPTOI: -
2372 case OP_NOTPOSUPTOI: -
2373 caseless = TRUE;
never executed (the execution status of this line is deduced): caseless = 1;
-
2374 codevalue -= OP_STARI - OP_STAR;
never executed (the execution status of this line is deduced): codevalue -= OP_STARI - OP_STAR;
-
2375 /* Fall through */ -
2376 case OP_UPTO:
code before this statement never executed: case OP_UPTO:
0
2377 case OP_MINUPTO: -
2378 case OP_POSUPTO: -
2379 case OP_NOTUPTO: -
2380 case OP_NOTMINUPTO: -
2381 case OP_NOTPOSUPTO: -
2382 ADD_ACTIVE(state_offset + dlen + 1 + IMM2_SIZE, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2383 count = current_state->count; /* Number already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
2384 if (clen > 0)
never evaluated: clen > 0
0
2385 { -
2386 unsigned int otherd = NOTACHAR;
never executed (the execution status of this line is deduced): unsigned int otherd = 0xffffffff;
-
2387 if (caseless)
never evaluated: caseless
0
2388 { -
2389#ifdef SUPPORT_UTF -
2390 if (utf && d >= 128)
never evaluated: utf
never evaluated: d >= 128
0
2391 { -
2392#ifdef SUPPORT_UCP -
2393 otherd = UCD_OTHERCASE(d);
never executed (the execution status of this line is deduced): otherd = (d + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(d) / 128] * 128 + (d) % 128])->other_case);
-
2394#endif /* SUPPORT_UCP */ -
2395 }
never executed: }
0
2396 else -
2397#endif /* SUPPORT_UTF */ -
2398 otherd = TABLE_GET(d, fcc, d);
never executed: otherd = (((d) <= 255u)? ((fcc)[d]):(d));
never evaluated: ((d) <= 255u)
0
2399 } -
2400 if ((c == d || c == otherd) == (codevalue < OP_NOTSTAR))
never evaluated: (c == d || c == otherd) == (codevalue < OP_NOTSTAR)
never evaluated: c == d
never evaluated: c == otherd
0
2401 { -
2402 if (codevalue == OP_POSUPTO || codevalue == OP_NOTPOSUPTO)
never evaluated: codevalue == OP_POSUPTO
never evaluated: codevalue == OP_NOTPOSUPTO
0
2403 { -
2404 active_count--; /* Remove non-match possibility */
never executed (the execution status of this line is deduced): active_count--;
-
2405 next_active_state--;
never executed (the execution status of this line is deduced): next_active_state--;
-
2406 }
never executed: }
0
2407 if (++count >= GET2(code, 1))
never evaluated: ++count >= code[1]
0
2408 { ADD_NEW(state_offset + dlen + 1 + IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2409 else -
2410 { ADD_NEW(state_offset, count); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2411 } -
2412 }
never executed: }
0
2413 break;
never executed: break;
0
2414 -
2415 -
2416/* ========================================================================== */ -
2417 /* These are the class-handling opcodes */ -
2418 -
2419 case OP_CLASS: -
2420 case OP_NCLASS: -
2421 case OP_XCLASS: -
2422 { -
2423 BOOL isinclass = FALSE;
never executed (the execution status of this line is deduced): BOOL isinclass = 0;
-
2424 int next_state_offset;
never executed (the execution status of this line is deduced): int next_state_offset;
-
2425 const pcre_uchar *ecode;
never executed (the execution status of this line is deduced): const pcre_uchar *ecode;
-
2426 -
2427 /* For a simple class, there is always just a 32-byte table, and we -
2428 can set isinclass from it. */ -
2429 -
2430 if (codevalue != OP_XCLASS)
never evaluated: codevalue != OP_XCLASS
0
2431 { -
2432 ecode = code + 1 + (32 / sizeof(pcre_uchar));
never executed (the execution status of this line is deduced): ecode = code + 1 + (32 / sizeof(pcre_uchar));
-
2433 if (clen > 0)
never evaluated: clen > 0
0
2434 { -
2435 isinclass = (c > 255)? (codevalue == OP_NCLASS) :
never evaluated: (c > 255)
0
2436 ((((pcre_uint8 *)(code + 1))[c/8] & (1 << (c&7))) != 0);
never executed (the execution status of this line is deduced): ((((pcre_uint8 *)(code + 1))[c/8] & (1 << (c&7))) != 0);
-
2437 }
never executed: }
0
2438 }
never executed: }
0
2439 -
2440 /* An extended class may have a table or a list of single characters, -
2441 ranges, or both, and it may be positive or negative. There's a -
2442 function that sorts all this out. */ -
2443 -
2444 else -
2445 { -
2446 ecode = code + GET(code, 1);
never executed (the execution status of this line is deduced): ecode = code + (code[1]);
-
2447 if (clen > 0) isinclass = PRIV(xclass)(c, code + 1 + LINK_SIZE, utf);
never executed: isinclass = _pcre16_xclass(c, code + 1 + 1, utf);
never evaluated: clen > 0
0
2448 }
never executed: }
0
2449 -
2450 /* At this point, isinclass is set for all kinds of class, and ecode -
2451 points to the byte after the end of the class. If there is a -
2452 quantifier, this is where it will be. */ -
2453 -
2454 next_state_offset = (int)(ecode - start_code);
never executed (the execution status of this line is deduced): next_state_offset = (int)(ecode - start_code);
-
2455 -
2456 switch (*ecode) -
2457 { -
2458 case OP_CRSTAR: -
2459 case OP_CRMINSTAR: -
2460 ADD_ACTIVE(next_state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2461 if (isinclass) { ADD_NEW(state_offset, 0); }
never executed: }
never executed: return (-19);
never evaluated: isinclass
never evaluated: new_count++ < wscount
0
2462 break;
never executed: break;
0
2463 -
2464 case OP_CRPLUS: -
2465 case OP_CRMINPLUS: -
2466 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
2467 if (count > 0) { ADD_ACTIVE(next_state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: count > 0
never evaluated: active_count++ < wscount
0
2468 if (isinclass) { count++; ADD_NEW(state_offset, count); }
never executed: }
never executed: return (-19);
never evaluated: isinclass
never evaluated: new_count++ < wscount
0
2469 break;
never executed: break;
0
2470 -
2471 case OP_CRQUERY: -
2472 case OP_CRMINQUERY: -
2473 ADD_ACTIVE(next_state_offset + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2474 if (isinclass) { ADD_NEW(next_state_offset + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: isinclass
never evaluated: new_count++ < wscount
0
2475 break;
never executed: break;
0
2476 -
2477 case OP_CRRANGE: -
2478 case OP_CRMINRANGE: -
2479 count = current_state->count; /* Already matched */
never executed (the execution status of this line is deduced): count = current_state->count;
-
2480 if (count >= GET2(ecode, 1))
never evaluated: count >= ecode[1]
0
2481 { ADD_ACTIVE(next_state_offset + 1 + 2 * IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2482 if (isinclass)
never evaluated: isinclass
0
2483 { -
2484 int max = GET2(ecode, 1 + IMM2_SIZE);
never executed (the execution status of this line is deduced): int max = ecode[1 + 1];
-
2485 if (++count >= max && max != 0) /* Max 0 => no limit */
never evaluated: ++count >= max
never evaluated: max != 0
0
2486 { ADD_NEW(next_state_offset + 1 + 2 * IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2487 else -
2488 { ADD_NEW(state_offset, count); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2489 } -
2490 break;
never executed: break;
0
2491 -
2492 default: -
2493 if (isinclass) { ADD_NEW(next_state_offset, 0); }
never executed: }
never executed: return (-19);
never evaluated: isinclass
never evaluated: new_count++ < wscount
0
2494 break;
never executed: break;
0
2495 } -
2496 } -
2497 break;
never executed: break;
0
2498 -
2499/* ========================================================================== */ -
2500 /* These are the opcodes for fancy brackets of various kinds. We have -
2501 to use recursion in order to handle them. The "always failing" assertion -
2502 (?!) is optimised to OP_FAIL when compiling, so we have to support that, -
2503 though the other "backtracking verbs" are not supported. */ -
2504 -
2505 case OP_FAIL: -
2506 forced_fail++; /* Count FAILs for multiple states */
never executed (the execution status of this line is deduced): forced_fail++;
-
2507 break;
never executed: break;
0
2508 -
2509 case OP_ASSERT: -
2510 case OP_ASSERT_NOT: -
2511 case OP_ASSERTBACK: -
2512 case OP_ASSERTBACK_NOT: -
2513 { -
2514 int rc;
never executed (the execution status of this line is deduced): int rc;
-
2515 int local_offsets[2];
never executed (the execution status of this line is deduced): int local_offsets[2];
-
2516 int local_workspace[1000];
never executed (the execution status of this line is deduced): int local_workspace[1000];
-
2517 const pcre_uchar *endasscode = code + GET(code, 1);
never executed (the execution status of this line is deduced): const pcre_uchar *endasscode = code + (code[1]);
-
2518 -
2519 while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1);
never executed: endasscode += (endasscode[1]);
never evaluated: *endasscode == OP_ALT
0
2520 -
2521 rc = internal_dfa_exec(
never executed (the execution status of this line is deduced): rc = internal_dfa_exec(
-
2522 md, /* static match data */
never executed (the execution status of this line is deduced): md,
-
2523 code, /* this subexpression's code */
never executed (the execution status of this line is deduced): code,
-
2524 ptr, /* where we currently are */
never executed (the execution status of this line is deduced): ptr,
-
2525 (int)(ptr - start_subject), /* start offset */
never executed (the execution status of this line is deduced): (int)(ptr - start_subject),
-
2526 local_offsets, /* offset vector */
never executed (the execution status of this line is deduced): local_offsets,
-
2527 sizeof(local_offsets)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_offsets)/sizeof(int),
-
2528 local_workspace, /* workspace vector */
never executed (the execution status of this line is deduced): local_workspace,
-
2529 sizeof(local_workspace)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_workspace)/sizeof(int),
-
2530 rlevel); /* function recursion level */
never executed (the execution status of this line is deduced): rlevel);
-
2531 -
2532 if (rc == PCRE_ERROR_DFA_UITEM) return rc;
never executed: return rc;
never evaluated: rc == (-16)
0
2533 if ((rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK))
never evaluated: (rc >= 0) == (codevalue == OP_ASSERT || codevalue == OP_ASSERTBACK)
never evaluated: codevalue == OP_ASSERT
never evaluated: codevalue == OP_ASSERTBACK
0
2534 { ADD_ACTIVE((int)(endasscode + LINK_SIZE + 1 - start_code), 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2535 } -
2536 break;
never executed: break;
0
2537 -
2538 /*-----------------------------------------------------------------*/ -
2539 case OP_COND: -
2540 case OP_SCOND: -
2541 { -
2542 int local_offsets[1000];
never executed (the execution status of this line is deduced): int local_offsets[1000];
-
2543 int local_workspace[1000];
never executed (the execution status of this line is deduced): int local_workspace[1000];
-
2544 int codelink = GET(code, 1);
never executed (the execution status of this line is deduced): int codelink = (code[1]);
-
2545 int condcode;
never executed (the execution status of this line is deduced): int condcode;
-
2546 -
2547 /* Because of the way auto-callout works during compile, a callout item -
2548 is inserted between OP_COND and an assertion condition. This does not -
2549 happen for the other conditions. */ -
2550 -
2551 if (code[LINK_SIZE+1] == OP_CALLOUT)
never evaluated: code[1 +1] == OP_CALLOUT
0
2552 { -
2553 rrc = 0;
never executed (the execution status of this line is deduced): rrc = 0;
-
2554 if (PUBL(callout) != NULL)
never evaluated: pcre16_callout != ((void *)0)
0
2555 { -
2556 PUBL(callout_block) cb;
never executed (the execution status of this line is deduced): pcre16_callout_block cb;
-
2557 cb.version = 1; /* Version 1 of the callout block */
never executed (the execution status of this line is deduced): cb.version = 1;
-
2558 cb.callout_number = code[LINK_SIZE+2];
never executed (the execution status of this line is deduced): cb.callout_number = code[1 +2];
-
2559 cb.offset_vector = offsets;
never executed (the execution status of this line is deduced): cb.offset_vector = offsets;
-
2560#ifdef COMPILE_PCRE8 -
2561 cb.subject = (PCRE_SPTR)start_subject; -
2562#else -
2563 cb.subject = (PCRE_SPTR16)start_subject;
never executed (the execution status of this line is deduced): cb.subject = (const unsigned short *)start_subject;
-
2564#endif -
2565 cb.subject_length = (int)(end_subject - start_subject);
never executed (the execution status of this line is deduced): cb.subject_length = (int)(end_subject - start_subject);
-
2566 cb.start_match = (int)(current_subject - start_subject);
never executed (the execution status of this line is deduced): cb.start_match = (int)(current_subject - start_subject);
-
2567 cb.current_position = (int)(ptr - start_subject);
never executed (the execution status of this line is deduced): cb.current_position = (int)(ptr - start_subject);
-
2568 cb.pattern_position = GET(code, LINK_SIZE + 3);
never executed (the execution status of this line is deduced): cb.pattern_position = (code[1 + 3]);
-
2569 cb.next_item_length = GET(code, 3 + 2*LINK_SIZE);
never executed (the execution status of this line is deduced): cb.next_item_length = (code[3 + 2*1]);
-
2570 cb.capture_top = 1;
never executed (the execution status of this line is deduced): cb.capture_top = 1;
-
2571 cb.capture_last = -1;
never executed (the execution status of this line is deduced): cb.capture_last = -1;
-
2572 cb.callout_data = md->callout_data;
never executed (the execution status of this line is deduced): cb.callout_data = md->callout_data;
-
2573 cb.mark = NULL; /* No (*MARK) support */
never executed (the execution status of this line is deduced): cb.mark = ((void *)0);
-
2574 if ((rrc = (*PUBL(callout))(&cb)) < 0) return rrc; /* Abandon */
never executed: return rrc;
never evaluated: (rrc = (*pcre16_callout)(&cb)) < 0
0
2575 }
never executed: }
0
2576 if (rrc > 0) break; /* Fail this thread */
never executed: break;
never evaluated: rrc > 0
0
2577 code += PRIV(OP_lengths)[OP_CALLOUT]; /* Skip callout data */
never executed (the execution status of this line is deduced): code += _pcre16_OP_lengths[OP_CALLOUT];
-
2578 }
never executed: }
0
2579 -
2580 condcode = code[LINK_SIZE+1];
never executed (the execution status of this line is deduced): condcode = code[1 +1];
-
2581 -
2582 /* Back reference conditions are not supported */ -
2583 -
2584 if (condcode == OP_CREF || condcode == OP_NCREF)
never evaluated: condcode == OP_CREF
never evaluated: condcode == OP_NCREF
0
2585 return PCRE_ERROR_DFA_UCOND;
never executed: return (-17);
0
2586 -
2587 /* The DEFINE condition is always false */ -
2588 -
2589 if (condcode == OP_DEF)
never evaluated: condcode == OP_DEF
0
2590 { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2591 -
2592 /* The only supported version of OP_RREF is for the value RREF_ANY, -
2593 which means "test if in any recursion". We can't test for specifically -
2594 recursed groups. */ -
2595 -
2596 else if (condcode == OP_RREF || condcode == OP_NRREF)
never evaluated: condcode == OP_RREF
never evaluated: condcode == OP_NRREF
0
2597 { -
2598 int value = GET2(code, LINK_SIZE + 2);
never executed (the execution status of this line is deduced): int value = code[1 + 2];
-
2599 if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND;
never executed: return (-17);
never evaluated: value != 0xffff
0
2600 if (md->recursive != NULL)
never evaluated: md->recursive != ((void *)0)
0
2601 { ADD_ACTIVE(state_offset + LINK_SIZE + 2 + IMM2_SIZE, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2602 else { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2603 } -
2604 -
2605 /* Otherwise, the condition is an assertion */ -
2606 -
2607 else -
2608 { -
2609 int rc;
never executed (the execution status of this line is deduced): int rc;
-
2610 const pcre_uchar *asscode = code + LINK_SIZE + 1;
never executed (the execution status of this line is deduced): const pcre_uchar *asscode = code + 1 + 1;
-
2611 const pcre_uchar *endasscode = asscode + GET(asscode, 1);
never executed (the execution status of this line is deduced): const pcre_uchar *endasscode = asscode + (asscode[1]);
-
2612 -
2613 while (*endasscode == OP_ALT) endasscode += GET(endasscode, 1);
never executed: endasscode += (endasscode[1]);
never evaluated: *endasscode == OP_ALT
0
2614 -
2615 rc = internal_dfa_exec(
never executed (the execution status of this line is deduced): rc = internal_dfa_exec(
-
2616 md, /* fixed match data */
never executed (the execution status of this line is deduced): md,
-
2617 asscode, /* this subexpression's code */
never executed (the execution status of this line is deduced): asscode,
-
2618 ptr, /* where we currently are */
never executed (the execution status of this line is deduced): ptr,
-
2619 (int)(ptr - start_subject), /* start offset */
never executed (the execution status of this line is deduced): (int)(ptr - start_subject),
-
2620 local_offsets, /* offset vector */
never executed (the execution status of this line is deduced): local_offsets,
-
2621 sizeof(local_offsets)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_offsets)/sizeof(int),
-
2622 local_workspace, /* workspace vector */
never executed (the execution status of this line is deduced): local_workspace,
-
2623 sizeof(local_workspace)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_workspace)/sizeof(int),
-
2624 rlevel); /* function recursion level */
never executed (the execution status of this line is deduced): rlevel);
-
2625 -
2626 if (rc == PCRE_ERROR_DFA_UITEM) return rc;
never executed: return rc;
never evaluated: rc == (-16)
0
2627 if ((rc >= 0) ==
never evaluated: (rc >= 0) == (condcode == OP_ASSERT || condcode == OP_ASSERTBACK)
0
2628 (condcode == OP_ASSERT || condcode == OP_ASSERTBACK))
never evaluated: (rc >= 0) == (condcode == OP_ASSERT || condcode == OP_ASSERTBACK)
never evaluated: condcode == OP_ASSERT
never evaluated: condcode == OP_ASSERTBACK
0
2629 { ADD_ACTIVE((int)(endasscode + LINK_SIZE + 1 - start_code), 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2630 else -
2631 { ADD_ACTIVE(state_offset + codelink + LINK_SIZE + 1, 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2632 } -
2633 } -
2634 break;
never executed: break;
0
2635 -
2636 /*-----------------------------------------------------------------*/ -
2637 case OP_RECURSE: -
2638 { -
2639 dfa_recursion_info *ri;
never executed (the execution status of this line is deduced): dfa_recursion_info *ri;
-
2640 int local_offsets[1000];
never executed (the execution status of this line is deduced): int local_offsets[1000];
-
2641 int local_workspace[1000];
never executed (the execution status of this line is deduced): int local_workspace[1000];
-
2642 const pcre_uchar *callpat = start_code + GET(code, 1);
never executed (the execution status of this line is deduced): const pcre_uchar *callpat = start_code + (code[1]);
-
2643 int recno = (callpat == md->start_code)? 0 :
never evaluated: (callpat == md->start_code)
0
2644 GET2(callpat, 1 + LINK_SIZE);
never executed (the execution status of this line is deduced): callpat[1 + 1];
-
2645 int rc;
never executed (the execution status of this line is deduced): int rc;
-
2646 -
2647 DPRINTF(("%.*sStarting regex recursion\n", rlevel*2-2, SP)); -
2648 -
2649 /* Check for repeating a recursion without advancing the subject -
2650 pointer. This should catch convoluted mutual recursions. (Some simple -
2651 cases are caught at compile time.) */ -
2652 -
2653 for (ri = md->recursive; ri != NULL; ri = ri->prevrec)
never evaluated: ri != ((void *)0)
0
2654 if (recno == ri->group_num && ptr == ri->subject_position)
never evaluated: recno == ri->group_num
never evaluated: ptr == ri->subject_position
0
2655 return PCRE_ERROR_RECURSELOOP;
never executed: return (-26);
0
2656 -
2657 /* Remember this recursion and where we started it so as to -
2658 catch infinite loops. */ -
2659 -
2660 new_recursive.group_num = recno;
never executed (the execution status of this line is deduced): new_recursive.group_num = recno;
-
2661 new_recursive.subject_position = ptr;
never executed (the execution status of this line is deduced): new_recursive.subject_position = ptr;
-
2662 new_recursive.prevrec = md->recursive;
never executed (the execution status of this line is deduced): new_recursive.prevrec = md->recursive;
-
2663 md->recursive = &new_recursive;
never executed (the execution status of this line is deduced): md->recursive = &new_recursive;
-
2664 -
2665 rc = internal_dfa_exec(
never executed (the execution status of this line is deduced): rc = internal_dfa_exec(
-
2666 md, /* fixed match data */
never executed (the execution status of this line is deduced): md,
-
2667 callpat, /* this subexpression's code */
never executed (the execution status of this line is deduced): callpat,
-
2668 ptr, /* where we currently are */
never executed (the execution status of this line is deduced): ptr,
-
2669 (int)(ptr - start_subject), /* start offset */
never executed (the execution status of this line is deduced): (int)(ptr - start_subject),
-
2670 local_offsets, /* offset vector */
never executed (the execution status of this line is deduced): local_offsets,
-
2671 sizeof(local_offsets)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_offsets)/sizeof(int),
-
2672 local_workspace, /* workspace vector */
never executed (the execution status of this line is deduced): local_workspace,
-
2673 sizeof(local_workspace)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_workspace)/sizeof(int),
-
2674 rlevel); /* function recursion level */
never executed (the execution status of this line is deduced): rlevel);
-
2675 -
2676 md->recursive = new_recursive.prevrec; /* Done this recursion */
never executed (the execution status of this line is deduced): md->recursive = new_recursive.prevrec;
-
2677 -
2678 DPRINTF(("%.*sReturn from regex recursion: rc=%d\n", rlevel*2-2, SP, -
2679 rc)); -
2680 -
2681 /* Ran out of internal offsets */ -
2682 -
2683 if (rc == 0) return PCRE_ERROR_DFA_RECURSE;
never executed: return (-20);
never evaluated: rc == 0
0
2684 -
2685 /* For each successful matched substring, set up the next state with a -
2686 count of characters to skip before trying it. Note that the count is in -
2687 characters, not bytes. */ -
2688 -
2689 if (rc > 0)
never evaluated: rc > 0
0
2690 { -
2691 for (rc = rc*2 - 2; rc >= 0; rc -= 2)
never evaluated: rc >= 0
0
2692 { -
2693 int charcount = local_offsets[rc+1] - local_offsets[rc];
never executed (the execution status of this line is deduced): int charcount = local_offsets[rc+1] - local_offsets[rc];
-
2694#ifdef SUPPORT_UTF -
2695 const pcre_uchar *p = start_subject + local_offsets[rc];
never executed (the execution status of this line is deduced): const pcre_uchar *p = start_subject + local_offsets[rc];
-
2696 const pcre_uchar *pp = start_subject + local_offsets[rc+1];
never executed (the execution status of this line is deduced): const pcre_uchar *pp = start_subject + local_offsets[rc+1];
-
2697 while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
never executed: charcount--;
never evaluated: (((*p++) & 0xfc00) == 0xdc00)
never evaluated: p < pp
0
2698#endif -
2699 if (charcount > 0)
never evaluated: charcount > 0
0
2700 { -
2701 ADD_NEW_DATA(-(state_offset + LINK_SIZE + 1), 0, (charcount - 1));
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2702 } -
2703 else -
2704 { -
2705 ADD_ACTIVE(state_offset + LINK_SIZE + 1, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2706 } -
2707 } -
2708 }
never executed: }
0
2709 else if (rc != PCRE_ERROR_NOMATCH) return rc;
never executed: return rc;
never evaluated: rc != (-1)
0
2710 } -
2711 break;
never executed: break;
0
2712 -
2713 /*-----------------------------------------------------------------*/ -
2714 case OP_BRAPOS: -
2715 case OP_SBRAPOS: -
2716 case OP_CBRAPOS: -
2717 case OP_SCBRAPOS: -
2718 case OP_BRAPOSZERO: -
2719 { -
2720 int charcount, matched_count;
never executed (the execution status of this line is deduced): int charcount, matched_count;
-
2721 const pcre_uchar *local_ptr = ptr;
never executed (the execution status of this line is deduced): const pcre_uchar *local_ptr = ptr;
-
2722 BOOL allow_zero;
never executed (the execution status of this line is deduced): BOOL allow_zero;
-
2723 -
2724 if (codevalue == OP_BRAPOSZERO)
never evaluated: codevalue == OP_BRAPOSZERO
0
2725 { -
2726 allow_zero = TRUE;
never executed (the execution status of this line is deduced): allow_zero = 1;
-
2727 codevalue = *(++code); /* Codevalue will be one of above BRAs */
never executed (the execution status of this line is deduced): codevalue = *(++code);
-
2728 }
never executed: }
0
2729 else allow_zero = FALSE;
never executed: allow_zero = 0;
0
2730 -
2731 /* Loop to match the subpattern as many times as possible as if it were -
2732 a complete pattern. */ -
2733 -
2734 for (matched_count = 0;; matched_count++)
never executed (the execution status of this line is deduced): for (matched_count = 0;; matched_count++)
-
2735 { -
2736 int local_offsets[2];
never executed (the execution status of this line is deduced): int local_offsets[2];
-
2737 int local_workspace[1000];
never executed (the execution status of this line is deduced): int local_workspace[1000];
-
2738 -
2739 int rc = internal_dfa_exec(
never executed (the execution status of this line is deduced): int rc = internal_dfa_exec(
-
2740 md, /* fixed match data */
never executed (the execution status of this line is deduced): md,
-
2741 code, /* this subexpression's code */
never executed (the execution status of this line is deduced): code,
-
2742 local_ptr, /* where we currently are */
never executed (the execution status of this line is deduced): local_ptr,
-
2743 (int)(ptr - start_subject), /* start offset */
never executed (the execution status of this line is deduced): (int)(ptr - start_subject),
-
2744 local_offsets, /* offset vector */
never executed (the execution status of this line is deduced): local_offsets,
-
2745 sizeof(local_offsets)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_offsets)/sizeof(int),
-
2746 local_workspace, /* workspace vector */
never executed (the execution status of this line is deduced): local_workspace,
-
2747 sizeof(local_workspace)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_workspace)/sizeof(int),
-
2748 rlevel); /* function recursion level */
never executed (the execution status of this line is deduced): rlevel);
-
2749 -
2750 /* Failed to match */ -
2751 -
2752 if (rc < 0)
never evaluated: rc < 0
0
2753 { -
2754 if (rc != PCRE_ERROR_NOMATCH) return rc;
never executed: return rc;
never evaluated: rc != (-1)
0
2755 break;
never executed: break;
0
2756 } -
2757 -
2758 /* Matched: break the loop if zero characters matched. */ -
2759 -
2760 charcount = local_offsets[1] - local_offsets[0];
never executed (the execution status of this line is deduced): charcount = local_offsets[1] - local_offsets[0];
-
2761 if (charcount == 0) break;
never executed: break;
never evaluated: charcount == 0
0
2762 local_ptr += charcount; /* Advance temporary position ptr */
never executed (the execution status of this line is deduced): local_ptr += charcount;
-
2763 }
never executed: }
0
2764 -
2765 /* At this point we have matched the subpattern matched_count -
2766 times, and local_ptr is pointing to the character after the end of the -
2767 last match. */ -
2768 -
2769 if (matched_count > 0 || allow_zero)
never evaluated: matched_count > 0
never evaluated: allow_zero
0
2770 { -
2771 const pcre_uchar *end_subpattern = code;
never executed (the execution status of this line is deduced): const pcre_uchar *end_subpattern = code;
-
2772 int next_state_offset;
never executed (the execution status of this line is deduced): int next_state_offset;
-
2773 -
2774 do { end_subpattern += GET(end_subpattern, 1); }
never executed: }
0
2775 while (*end_subpattern == OP_ALT);
never evaluated: *end_subpattern == OP_ALT
0
2776 next_state_offset =
never executed (the execution status of this line is deduced): next_state_offset =
-
2777 (int)(end_subpattern - start_code + LINK_SIZE + 1);
never executed (the execution status of this line is deduced): (int)(end_subpattern - start_code + 1 + 1);
-
2778 -
2779 /* Optimization: if there are no more active states, and there -
2780 are no new states yet set up, then skip over the subject string -
2781 right here, to save looping. Otherwise, set up the new state to swing -
2782 into action when the end of the matched substring is reached. */ -
2783 -
2784 if (i + 1 >= active_count && new_count == 0)
never evaluated: i + 1 >= active_count
never evaluated: new_count == 0
0
2785 { -
2786 ptr = local_ptr;
never executed (the execution status of this line is deduced): ptr = local_ptr;
-
2787 clen = 0;
never executed (the execution status of this line is deduced): clen = 0;
-
2788 ADD_NEW(next_state_offset, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2789 } -
2790 else -
2791 { -
2792 const pcre_uchar *p = ptr;
never executed (the execution status of this line is deduced): const pcre_uchar *p = ptr;
-
2793 const pcre_uchar *pp = local_ptr;
never executed (the execution status of this line is deduced): const pcre_uchar *pp = local_ptr;
-
2794 charcount = (int)(pp - p);
never executed (the execution status of this line is deduced): charcount = (int)(pp - p);
-
2795#ifdef SUPPORT_UTF -
2796 while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
never executed: charcount--;
never evaluated: (((*p++) & 0xfc00) == 0xdc00)
never evaluated: p < pp
0
2797#endif -
2798 ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2799 } -
2800 } -
2801 } -
2802 break;
never executed: break;
0
2803 -
2804 /*-----------------------------------------------------------------*/ -
2805 case OP_ONCE: -
2806 case OP_ONCE_NC: -
2807 { -
2808 int local_offsets[2];
never executed (the execution status of this line is deduced): int local_offsets[2];
-
2809 int local_workspace[1000];
never executed (the execution status of this line is deduced): int local_workspace[1000];
-
2810 -
2811 int rc = internal_dfa_exec(
never executed (the execution status of this line is deduced): int rc = internal_dfa_exec(
-
2812 md, /* fixed match data */
never executed (the execution status of this line is deduced): md,
-
2813 code, /* this subexpression's code */
never executed (the execution status of this line is deduced): code,
-
2814 ptr, /* where we currently are */
never executed (the execution status of this line is deduced): ptr,
-
2815 (int)(ptr - start_subject), /* start offset */
never executed (the execution status of this line is deduced): (int)(ptr - start_subject),
-
2816 local_offsets, /* offset vector */
never executed (the execution status of this line is deduced): local_offsets,
-
2817 sizeof(local_offsets)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_offsets)/sizeof(int),
-
2818 local_workspace, /* workspace vector */
never executed (the execution status of this line is deduced): local_workspace,
-
2819 sizeof(local_workspace)/sizeof(int), /* size of same */
never executed (the execution status of this line is deduced): sizeof(local_workspace)/sizeof(int),
-
2820 rlevel); /* function recursion level */
never executed (the execution status of this line is deduced): rlevel);
-
2821 -
2822 if (rc >= 0)
never evaluated: rc >= 0
0
2823 { -
2824 const pcre_uchar *end_subpattern = code;
never executed (the execution status of this line is deduced): const pcre_uchar *end_subpattern = code;
-
2825 int charcount = local_offsets[1] - local_offsets[0];
never executed (the execution status of this line is deduced): int charcount = local_offsets[1] - local_offsets[0];
-
2826 int next_state_offset, repeat_state_offset;
never executed (the execution status of this line is deduced): int next_state_offset, repeat_state_offset;
-
2827 -
2828 do { end_subpattern += GET(end_subpattern, 1); }
never executed: }
0
2829 while (*end_subpattern == OP_ALT);
never evaluated: *end_subpattern == OP_ALT
0
2830 next_state_offset =
never executed (the execution status of this line is deduced): next_state_offset =
-
2831 (int)(end_subpattern - start_code + LINK_SIZE + 1);
never executed (the execution status of this line is deduced): (int)(end_subpattern - start_code + 1 + 1);
-
2832 -
2833 /* If the end of this subpattern is KETRMAX or KETRMIN, we must -
2834 arrange for the repeat state also to be added to the relevant list. -
2835 Calculate the offset, or set -1 for no repeat. */ -
2836 -
2837 repeat_state_offset = (*end_subpattern == OP_KETRMAX ||
never evaluated: *end_subpattern == OP_KETRMAX
0
2838 *end_subpattern == OP_KETRMIN)?
never evaluated: *end_subpattern == OP_KETRMIN
0
2839 (int)(end_subpattern - start_code - GET(end_subpattern, 1)) : -1;
never executed (the execution status of this line is deduced): (int)(end_subpattern - start_code - (end_subpattern[1])) : -1;
-
2840 -
2841 /* If we have matched an empty string, add the next state at the -
2842 current character pointer. This is important so that the duplicate -
2843 checking kicks in, which is what breaks infinite loops that match an -
2844 empty string. */ -
2845 -
2846 if (charcount == 0)
never evaluated: charcount == 0
0
2847 { -
2848 ADD_ACTIVE(next_state_offset, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2849 } -
2850 -
2851 /* Optimization: if there are no more active states, and there -
2852 are no new states yet set up, then skip over the subject string -
2853 right here, to save looping. Otherwise, set up the new state to swing -
2854 into action when the end of the matched substring is reached. */ -
2855 -
2856 else if (i + 1 >= active_count && new_count == 0)
never evaluated: i + 1 >= active_count
never evaluated: new_count == 0
0
2857 { -
2858 ptr += charcount;
never executed (the execution status of this line is deduced): ptr += charcount;
-
2859 clen = 0;
never executed (the execution status of this line is deduced): clen = 0;
-
2860 ADD_NEW(next_state_offset, 0);
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2861 -
2862 /* If we are adding a repeat state at the new character position, -
2863 we must fudge things so that it is the only current state. -
2864 Otherwise, it might be a duplicate of one we processed before, and -
2865 that would cause it to be skipped. */ -
2866 -
2867 if (repeat_state_offset >= 0)
never evaluated: repeat_state_offset >= 0
0
2868 { -
2869 next_active_state = active_states;
never executed (the execution status of this line is deduced): next_active_state = active_states;
-
2870 active_count = 0;
never executed (the execution status of this line is deduced): active_count = 0;
-
2871 i = -1;
never executed (the execution status of this line is deduced): i = -1;
-
2872 ADD_ACTIVE(repeat_state_offset, 0);
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2873 } -
2874 }
never executed: }
0
2875 else -
2876 { -
2877#ifdef SUPPORT_UTF -
2878 const pcre_uchar *p = start_subject + local_offsets[0];
never executed (the execution status of this line is deduced): const pcre_uchar *p = start_subject + local_offsets[0];
-
2879 const pcre_uchar *pp = start_subject + local_offsets[1];
never executed (the execution status of this line is deduced): const pcre_uchar *pp = start_subject + local_offsets[1];
-
2880 while (p < pp) if (NOT_FIRSTCHAR(*p++)) charcount--;
never executed: charcount--;
never evaluated: (((*p++) & 0xfc00) == 0xdc00)
never evaluated: p < pp
0
2881#endif -
2882 ADD_NEW_DATA(-next_state_offset, 0, (charcount - 1));
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2883 if (repeat_state_offset >= 0)
never evaluated: repeat_state_offset >= 0
0
2884 { ADD_NEW_DATA(-repeat_state_offset, 0, (charcount - 1)); }
never executed: }
never executed: return (-19);
never evaluated: new_count++ < wscount
0
2885 }
never executed: }
0
2886 } -
2887 else if (rc != PCRE_ERROR_NOMATCH) return rc;
never executed: return rc;
never evaluated: rc != (-1)
0
2888 } -
2889 break;
never executed: break;
0
2890 -
2891 -
2892/* ========================================================================== */ -
2893 /* Handle callouts */ -
2894 -
2895 case OP_CALLOUT: -
2896 rrc = 0;
never executed (the execution status of this line is deduced): rrc = 0;
-
2897 if (PUBL(callout) != NULL)
never evaluated: pcre16_callout != ((void *)0)
0
2898 { -
2899 PUBL(callout_block) cb;
never executed (the execution status of this line is deduced): pcre16_callout_block cb;
-
2900 cb.version = 1; /* Version 1 of the callout block */
never executed (the execution status of this line is deduced): cb.version = 1;
-
2901 cb.callout_number = code[1];
never executed (the execution status of this line is deduced): cb.callout_number = code[1];
-
2902 cb.offset_vector = offsets;
never executed (the execution status of this line is deduced): cb.offset_vector = offsets;
-
2903#ifdef COMPILE_PCRE8 -
2904 cb.subject = (PCRE_SPTR)start_subject; -
2905#else -
2906 cb.subject = (PCRE_SPTR16)start_subject;
never executed (the execution status of this line is deduced): cb.subject = (const unsigned short *)start_subject;
-
2907#endif -
2908 cb.subject_length = (int)(end_subject - start_subject);
never executed (the execution status of this line is deduced): cb.subject_length = (int)(end_subject - start_subject);
-
2909 cb.start_match = (int)(current_subject - start_subject);
never executed (the execution status of this line is deduced): cb.start_match = (int)(current_subject - start_subject);
-
2910 cb.current_position = (int)(ptr - start_subject);
never executed (the execution status of this line is deduced): cb.current_position = (int)(ptr - start_subject);
-
2911 cb.pattern_position = GET(code, 2);
never executed (the execution status of this line is deduced): cb.pattern_position = (code[2]);
-
2912 cb.next_item_length = GET(code, 2 + LINK_SIZE);
never executed (the execution status of this line is deduced): cb.next_item_length = (code[2 + 1]);
-
2913 cb.capture_top = 1;
never executed (the execution status of this line is deduced): cb.capture_top = 1;
-
2914 cb.capture_last = -1;
never executed (the execution status of this line is deduced): cb.capture_last = -1;
-
2915 cb.callout_data = md->callout_data;
never executed (the execution status of this line is deduced): cb.callout_data = md->callout_data;
-
2916 cb.mark = NULL; /* No (*MARK) support */
never executed (the execution status of this line is deduced): cb.mark = ((void *)0);
-
2917 if ((rrc = (*PUBL(callout))(&cb)) < 0) return rrc; /* Abandon */
never executed: return rrc;
never evaluated: (rrc = (*pcre16_callout)(&cb)) < 0
0
2918 }
never executed: }
0
2919 if (rrc == 0)
never evaluated: rrc == 0
0
2920 { ADD_ACTIVE(state_offset + PRIV(OP_lengths)[OP_CALLOUT], 0); }
never executed: }
never executed: return (-19);
never evaluated: active_count++ < wscount
0
2921 break;
never executed: break;
0
2922 -
2923 -
2924/* ========================================================================== */ -
2925 default: /* Unsupported opcode */ -
2926 return PCRE_ERROR_DFA_UITEM;
never executed: return (-16);
0
2927 } -
2928 -
2929 NEXT_ACTIVE_STATE: continue;
never executed: continue;
0
2930 -
2931 } /* End of loop scanning active states */ -
2932 -
2933 /* We have finished the processing at the current subject character. If no -
2934 new states have been set for the next character, we have found all the -
2935 matches that we are going to find. If we are at the top level and partial -
2936 matching has been requested, check for appropriate conditions. -
2937 -
2938 The "forced_ fail" variable counts the number of (*F) encountered for the -
2939 character. If it is equal to the original active_count (saved in -
2940 workspace[1]) it means that (*F) was found on every active state. In this -
2941 case we don't want to give a partial match. -
2942 -
2943 The "could_continue" variable is true if a state could have continued but -
2944 for the fact that the end of the subject was reached. */ -
2945 -
2946 if (new_count <= 0)
never evaluated: new_count <= 0
0
2947 { -
2948 if (rlevel == 1 && /* Top level, and */
never evaluated: rlevel == 1
0
2949 could_continue && /* Some could go on */
never evaluated: could_continue
0
2950 forced_fail != workspace[1] && /* Not all forced fail & */
never evaluated: forced_fail != workspace[1]
0
2951 ( /* either... */
never executed (the execution status of this line is deduced): (
-
2952 (md->moptions & PCRE_PARTIAL_HARD) != 0 /* Hard partial */
never evaluated: (md->moptions & 0x08000000) != 0
0
2953 || /* or... */
never executed (the execution status of this line is deduced): ||
-
2954 ((md->moptions & PCRE_PARTIAL_SOFT) != 0 && /* Soft partial and */
never evaluated: (md->moptions & 0x00008000) != 0
0
2955 match_count < 0) /* no matches */
never evaluated: match_count < 0
0
2956 ) && /* And... */
never executed (the execution status of this line is deduced): ) &&
-
2957 ptr >= end_subject && /* Reached end of subject */
never evaluated: ptr >= end_subject
0
2958 ptr > md->start_used_ptr) /* Inspected non-empty string */
never evaluated: ptr > md->start_used_ptr
0
2959 { -
2960 if (offsetcount >= 2)
never evaluated: offsetcount >= 2
0
2961 { -
2962 offsets[0] = (int)(md->start_used_ptr - start_subject);
never executed (the execution status of this line is deduced): offsets[0] = (int)(md->start_used_ptr - start_subject);
-
2963 offsets[1] = (int)(end_subject - start_subject);
never executed (the execution status of this line is deduced): offsets[1] = (int)(end_subject - start_subject);
-
2964 }
never executed: }
0
2965 match_count = PCRE_ERROR_PARTIAL;
never executed (the execution status of this line is deduced): match_count = (-12);
-
2966 }
never executed: }
0
2967 -
2968 DPRINTF(("%.*sEnd of internal_dfa_exec %d: returning %d\n" -
2969 "%.*s---------------------\n\n", rlevel*2-2, SP, rlevel, match_count, -
2970 rlevel*2-2, SP)); -
2971 break; /* In effect, "return", but see the comment below */
never executed: break;
0
2972 } -
2973 -
2974 /* One or more states are active for the next character. */ -
2975 -
2976 ptr += clen; /* Advance to next subject character */
never executed (the execution status of this line is deduced): ptr += clen;
-
2977 } /* Loop to move along the subject string */
never executed: }
0
2978 -
2979/* Control gets here from "break" a few lines above. We do it this way because -
2980if we use "return" above, we have compiler trouble. Some compilers warn if -
2981there's nothing here because they think the function doesn't return a value. On -
2982the other hand, if we put a dummy statement here, some more clever compilers -
2983complain that it can't be reached. Sigh. */ -
2984 -
2985return match_count;
never executed: return match_count;
0
2986} -
2987 -
2988 -
2989 -
2990 -
2991/************************************************* -
2992* Execute a Regular Expression - DFA engine * -
2993*************************************************/ -
2994 -
2995/* This external function applies a compiled re to a subject string using a DFA -
2996engine. This function calls the internal function multiple times if the pattern -
2997is not anchored. -
2998 -
2999Arguments: -
3000 argument_re points to the compiled expression -
3001 extra_data points to extra data or is NULL -
3002 subject points to the subject string -
3003 length length of subject string (may contain binary zeros) -
3004 start_offset where to start in the subject string -
3005 options option bits -
3006 offsets vector of match offsets -
3007 offsetcount size of same -
3008 workspace workspace vector -
3009 wscount size of same -
3010 -
3011Returns: > 0 => number of match offset pairs placed in offsets -
3012 = 0 => offsets overflowed; longest matches are present -
3013 -1 => failed to match -
3014 < -1 => some kind of unexpected problem -
3015*/ -
3016 -
3017#ifdef COMPILE_PCRE8 -
3018PCRE_EXP_DEFN int PCRE_CALL_CONVENTION -
3019pcre_dfa_exec(const pcre *argument_re, const pcre_extra *extra_data, -
3020 const char *subject, int length, int start_offset, int options, int *offsets, -
3021 int offsetcount, int *workspace, int wscount) -
3022#else -
3023PCRE_EXP_DEFN int PCRE_CALL_CONVENTION -
3024pcre16_dfa_exec(const pcre16 *argument_re, const pcre16_extra *extra_data, -
3025 PCRE_SPTR16 subject, int length, int start_offset, int options, int *offsets, -
3026 int offsetcount, int *workspace, int wscount) -
3027#endif -
3028{ -
3029REAL_PCRE *re = (REAL_PCRE *)argument_re;
never executed (the execution status of this line is deduced): real_pcre16 *re = (real_pcre16 *)argument_re;
-
3030dfa_match_data match_block;
never executed (the execution status of this line is deduced): dfa_match_data match_block;
-
3031dfa_match_data *md = &match_block;
never executed (the execution status of this line is deduced): dfa_match_data *md = &match_block;
-
3032BOOL utf, anchored, startline, firstline;
never executed (the execution status of this line is deduced): BOOL utf, anchored, startline, firstline;
-
3033const pcre_uchar *current_subject, *end_subject;
never executed (the execution status of this line is deduced): const pcre_uchar *current_subject, *end_subject;
-
3034const pcre_study_data *study = NULL;
never executed (the execution status of this line is deduced): const pcre_study_data *study = ((void *)0);
-
3035 -
3036const pcre_uchar *req_char_ptr;
never executed (the execution status of this line is deduced): const pcre_uchar *req_char_ptr;
-
3037const pcre_uint8 *start_bits = NULL;
never executed (the execution status of this line is deduced): const pcre_uint8 *start_bits = ((void *)0);
-
3038BOOL has_first_char = FALSE;
never executed (the execution status of this line is deduced): BOOL has_first_char = 0;
-
3039BOOL has_req_char = FALSE;
never executed (the execution status of this line is deduced): BOOL has_req_char = 0;
-
3040pcre_uchar first_char = 0;
never executed (the execution status of this line is deduced): pcre_uchar first_char = 0;
-
3041pcre_uchar first_char2 = 0;
never executed (the execution status of this line is deduced): pcre_uchar first_char2 = 0;
-
3042pcre_uchar req_char = 0;
never executed (the execution status of this line is deduced): pcre_uchar req_char = 0;
-
3043pcre_uchar req_char2 = 0;
never executed (the execution status of this line is deduced): pcre_uchar req_char2 = 0;
-
3044int newline;
never executed (the execution status of this line is deduced): int newline;
-
3045 -
3046/* Plausibility checks */ -
3047 -
3048if ((options & ~PUBLIC_DFA_EXEC_OPTIONS) != 0) return PCRE_ERROR_BADOPTION;
never executed: return (-3);
never evaluated: (options & ~(0x00000010|0x00000080|0x00000100|0x00000400|0x10000000| 0x00002000|0x08000000|0x00008000|0x00010000| 0x00020000|(0x00100000|0x00200000|0x00400000| 0x00500000)|0x00800000|0x01000000| 0x04000000)) != 0
0
3049if (re == NULL || subject == NULL || workspace == NULL ||
never evaluated: re == ((void *)0)
never evaluated: subject == ((void *)0)
never evaluated: workspace == ((void *)0)
0
3050 (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;
never executed: return (-2);
never evaluated: offsets == ((void *)0)
never evaluated: offsetcount > 0
0
3051if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
never executed: return (-15);
never evaluated: offsetcount < 0
0
3052if (wscount < 20) return PCRE_ERROR_DFA_WSSIZE;
never executed: return (-19);
never evaluated: wscount < 20
0
3053if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;
never executed: return (-24);
never evaluated: start_offset < 0
never evaluated: start_offset > length
0
3054 -
3055/* We need to find the pointer to any study data before we test for byte -
3056flipping, so we scan the extra_data block first. This may set two fields in the -
3057match block, so we must initialize them beforehand. However, the other fields -
3058in the match block must not be set until after the byte flipping. */ -
3059 -
3060md->tables = re->tables;
never executed (the execution status of this line is deduced): md->tables = re->tables;
-
3061md->callout_data = NULL;
never executed (the execution status of this line is deduced): md->callout_data = ((void *)0);
-
3062 -
3063if (extra_data != NULL)
never evaluated: extra_data != ((void *)0)
0
3064 { -
3065 unsigned int flags = extra_data->flags;
never executed (the execution status of this line is deduced): unsigned int flags = extra_data->flags;
-
3066 if ((flags & PCRE_EXTRA_STUDY_DATA) != 0)
never evaluated: (flags & 0x0001) != 0
0
3067 study = (const pcre_study_data *)extra_data->study_data;
never executed: study = (const pcre_study_data *)extra_data->study_data;
0
3068 if ((flags & PCRE_EXTRA_MATCH_LIMIT) != 0) return PCRE_ERROR_DFA_UMLIMIT;
never executed: return (-18);
never evaluated: (flags & 0x0002) != 0
0
3069 if ((flags & PCRE_EXTRA_MATCH_LIMIT_RECURSION) != 0)
never evaluated: (flags & 0x0010) != 0
0
3070 return PCRE_ERROR_DFA_UMLIMIT;
never executed: return (-18);
0
3071 if ((flags & PCRE_EXTRA_CALLOUT_DATA) != 0)
never evaluated: (flags & 0x0004) != 0
0
3072 md->callout_data = extra_data->callout_data;
never executed: md->callout_data = extra_data->callout_data;
0
3073 if ((flags & PCRE_EXTRA_TABLES) != 0)
never evaluated: (flags & 0x0008) != 0
0
3074 md->tables = extra_data->tables;
never executed: md->tables = extra_data->tables;
0
3075 }
never executed: }
0
3076 -
3077/* Check that the first field in the block is the magic number. If it is not, -
3078return with PCRE_ERROR_BADMAGIC. However, if the magic number is equal to -
3079REVERSED_MAGIC_NUMBER we return with PCRE_ERROR_BADENDIANNESS, which -
3080means that the pattern is likely compiled with different endianness. */ -
3081 -
3082if (re->magic_number != MAGIC_NUMBER)
never evaluated: re->magic_number != 0x50435245UL
0
3083 return re->magic_number == REVERSED_MAGIC_NUMBER?
never executed: return re->magic_number == 0x45524350UL? (-29):(-4);
0
3084 PCRE_ERROR_BADENDIANNESS:PCRE_ERROR_BADMAGIC;
never executed: return re->magic_number == 0x45524350UL? (-29):(-4);
0
3085if ((re->flags & PCRE_MODE) == 0) return PCRE_ERROR_BADMODE;
never executed: return (-28);
never evaluated: (re->flags & 0x0002) == 0
0
3086 -
3087/* Set some local values */ -
3088 -
3089current_subject = (const pcre_uchar *)subject + start_offset;
never executed (the execution status of this line is deduced): current_subject = (const pcre_uchar *)subject + start_offset;
-
3090end_subject = (const pcre_uchar *)subject + length;
never executed (the execution status of this line is deduced): end_subject = (const pcre_uchar *)subject + length;
-
3091req_char_ptr = current_subject - 1;
never executed (the execution status of this line is deduced): req_char_ptr = current_subject - 1;
-
3092 -
3093#ifdef SUPPORT_UTF -
3094/* PCRE_UTF16 has the same value as PCRE_UTF8. */ -
3095utf = (re->options & PCRE_UTF8) != 0;
never executed (the execution status of this line is deduced): utf = (re->options & 0x00000800) != 0;
-
3096#else -
3097utf = FALSE; -
3098#endif -
3099 -
3100anchored = (options & (PCRE_ANCHORED|PCRE_DFA_RESTART)) != 0 ||
never evaluated: (options & (0x00000010|0x00020000)) != 0
0
3101 (re->options & PCRE_ANCHORED) != 0;
never evaluated: (re->options & 0x00000010) != 0
0
3102 -
3103/* The remaining fixed data for passing around. */ -
3104 -
3105md->start_code = (const pcre_uchar *)argument_re +
never executed (the execution status of this line is deduced): md->start_code = (const pcre_uchar *)argument_re +
-
3106 re->name_table_offset + re->name_count * re->name_entry_size;
never executed (the execution status of this line is deduced): re->name_table_offset + re->name_count * re->name_entry_size;
-
3107md->start_subject = (const pcre_uchar *)subject;
never executed (the execution status of this line is deduced): md->start_subject = (const pcre_uchar *)subject;
-
3108md->end_subject = end_subject;
never executed (the execution status of this line is deduced): md->end_subject = end_subject;
-
3109md->start_offset = start_offset;
never executed (the execution status of this line is deduced): md->start_offset = start_offset;
-
3110md->moptions = options;
never executed (the execution status of this line is deduced): md->moptions = options;
-
3111md->poptions = re->options;
never executed (the execution status of this line is deduced): md->poptions = re->options;
-
3112 -
3113/* If the BSR option is not set at match time, copy what was set -
3114at compile time. */ -
3115 -
3116if ((md->moptions & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) == 0)
never evaluated: (md->moptions & (0x00800000|0x01000000)) == 0
0
3117 { -
3118 if ((re->options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) != 0)
never evaluated: (re->options & (0x00800000|0x01000000)) != 0
0
3119 md->moptions |= re->options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE);
never executed: md->moptions |= re->options & (0x00800000|0x01000000);
0
3120#ifdef BSR_ANYCRLF -
3121 else md->moptions |= PCRE_BSR_ANYCRLF; -
3122#endif -
3123 }
never executed: }
0
3124 -
3125/* Handle different types of newline. The three bits give eight cases. If -
3126nothing is set at run time, whatever was used at compile time applies. */ -
3127 -
3128switch ((((options & PCRE_NEWLINE_BITS) == 0)? re->options : (pcre_uint32)options) & -
3129 PCRE_NEWLINE_BITS) -
3130 { -
3131 case 0: newline = NEWLINE; break; /* Compile-time default */
never executed: break;
0
3132 case PCRE_NEWLINE_CR: newline = CHAR_CR; break;
never executed: break;
0
3133 case PCRE_NEWLINE_LF: newline = CHAR_NL; break;
never executed: break;
0
3134 case PCRE_NEWLINE_CR+ -
3135 PCRE_NEWLINE_LF: newline = (CHAR_CR << 8) | CHAR_NL; break;
never executed: break;
0
3136 case PCRE_NEWLINE_ANY: newline = -1; break;
never executed: break;
0
3137 case PCRE_NEWLINE_ANYCRLF: newline = -2; break;
never executed: break;
0
3138 default: return PCRE_ERROR_BADNEWLINE;
never executed: return (-23);
0
3139 } -
3140 -
3141if (newline == -2)
never evaluated: newline == -2
0
3142 { -
3143 md->nltype = NLTYPE_ANYCRLF;
never executed (the execution status of this line is deduced): md->nltype = 2;
-
3144 }
never executed: }
0
3145else if (newline < 0)
never evaluated: newline < 0
0
3146 { -
3147 md->nltype = NLTYPE_ANY;
never executed (the execution status of this line is deduced): md->nltype = 1;
-
3148 }
never executed: }
0
3149else -
3150 { -
3151 md->nltype = NLTYPE_FIXED;
never executed (the execution status of this line is deduced): md->nltype = 0;
-
3152 if (newline > 255)
never evaluated: newline > 255
0
3153 { -
3154 md->nllen = 2;
never executed (the execution status of this line is deduced): md->nllen = 2;
-
3155 md->nl[0] = (newline >> 8) & 255;
never executed (the execution status of this line is deduced): md->nl[0] = (newline >> 8) & 255;
-
3156 md->nl[1] = newline & 255;
never executed (the execution status of this line is deduced): md->nl[1] = newline & 255;
-
3157 }
never executed: }
0
3158 else -
3159 { -
3160 md->nllen = 1;
never executed (the execution status of this line is deduced): md->nllen = 1;
-
3161 md->nl[0] = newline;
never executed (the execution status of this line is deduced): md->nl[0] = newline;
-
3162 }
never executed: }
0
3163 } -
3164 -
3165/* Check a UTF-8 string if required. Unfortunately there's no way of passing -
3166back the character offset. */ -
3167 -
3168#ifdef SUPPORT_UTF -
3169if (utf && (options & PCRE_NO_UTF8_CHECK) == 0)
never evaluated: utf
never evaluated: (options & 0x00002000) == 0
0
3170 { -
3171 int erroroffset;
never executed (the execution status of this line is deduced): int erroroffset;
-
3172 int errorcode = PRIV(valid_utf)((pcre_uchar *)subject, length, &erroroffset);
never executed (the execution status of this line is deduced): int errorcode = _pcre16_valid_utf((pcre_uchar *)subject, length, &erroroffset);
-
3173 if (errorcode != 0)
never evaluated: errorcode != 0
0
3174 { -
3175 if (offsetcount >= 2)
never evaluated: offsetcount >= 2
0
3176 { -
3177 offsets[0] = erroroffset;
never executed (the execution status of this line is deduced): offsets[0] = erroroffset;
-
3178 offsets[1] = errorcode;
never executed (the execution status of this line is deduced): offsets[1] = errorcode;
-
3179 }
never executed: }
0
3180 return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)?
never executed: return (errorcode <= 5 && (options & 0x08000000) != 0)? (-25) : (-10);
0
3181 PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;
never executed: return (errorcode <= 5 && (options & 0x08000000) != 0)? (-25) : (-10);
0
3182 } -
3183 if (start_offset > 0 && start_offset < length &&
never evaluated: start_offset > 0
never evaluated: start_offset < length
0
3184 NOT_FIRSTCHAR(((PCRE_PUCHAR)subject)[start_offset]))
never evaluated: (((((const pcre_uchar *)subject)[start_offset]) & 0xfc00) == 0xdc00)
0
3185 return PCRE_ERROR_BADUTF8_OFFSET;
never executed: return (-11);
0
3186 }
never executed: }
0
3187#endif -
3188 -
3189/* If the exec call supplied NULL for tables, use the inbuilt ones. This -
3190is a feature that makes it possible to save compiled regex and re-use them -
3191in other programs later. */ -
3192 -
3193if (md->tables == NULL) md->tables = PRIV(default_tables);
never executed: md->tables = _pcre16_default_tables;
never evaluated: md->tables == ((void *)0)
0
3194 -
3195/* The "must be at the start of a line" flags are used in a loop when finding -
3196where to start. */ -
3197 -
3198startline = (re->flags & PCRE_STARTLINE) != 0;
never executed (the execution status of this line is deduced): startline = (re->flags & 0x0100) != 0;
-
3199firstline = (re->options & PCRE_FIRSTLINE) != 0;
never executed (the execution status of this line is deduced): firstline = (re->options & 0x00040000) != 0;
-
3200 -
3201/* Set up the first character to match, if available. The first_byte value is -
3202never set for an anchored regular expression, but the anchoring may be forced -
3203at run time, so we have to test for anchoring. The first char may be unset for -
3204an unanchored pattern, of course. If there's no first char and the pattern was -
3205studied, there may be a bitmap of possible first characters. */ -
3206 -
3207if (!anchored)
never evaluated: !anchored
0
3208 { -
3209 if ((re->flags & PCRE_FIRSTSET) != 0)
never evaluated: (re->flags & 0x0010) != 0
0
3210 { -
3211 has_first_char = TRUE;
never executed (the execution status of this line is deduced): has_first_char = 1;
-
3212 first_char = first_char2 = (pcre_uchar)(re->first_char);
never executed (the execution status of this line is deduced): first_char = first_char2 = (pcre_uchar)(re->first_char);
-
3213 if ((re->flags & PCRE_FCH_CASELESS) != 0)
never evaluated: (re->flags & 0x0020) != 0
0
3214 { -
3215 first_char2 = TABLE_GET(first_char, md->tables + fcc_offset, first_char);
never evaluated: ((first_char) <= 255u)
0
3216#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) -
3217 if (utf && first_char > 127)
never evaluated: utf
never evaluated: first_char > 127
0
3218 first_char2 = UCD_OTHERCASE(first_char);
never executed: first_char2 = (first_char + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(first_char) / 128] * 128 + (first_char) % 128])->other_case);
0
3219#endif -
3220 }
never executed: }
0
3221 }
never executed: }
0
3222 else -
3223 { -
3224 if (!startline && study != NULL &&
never evaluated: !startline
never evaluated: study != ((void *)0)
0
3225 (study->flags & PCRE_STUDY_MAPPED) != 0)
never evaluated: (study->flags & 0x0001) != 0
0
3226 start_bits = study->start_bits;
never executed: start_bits = study->start_bits;
0
3227 }
never executed: }
0
3228 } -
3229 -
3230/* For anchored or unanchored matches, there may be a "last known required -
3231character" set. */ -
3232 -
3233if ((re->flags & PCRE_REQCHSET) != 0)
never evaluated: (re->flags & 0x0040) != 0
0
3234 { -
3235 has_req_char = TRUE;
never executed (the execution status of this line is deduced): has_req_char = 1;
-
3236 req_char = req_char2 = (pcre_uchar)(re->req_char);
never executed (the execution status of this line is deduced): req_char = req_char2 = (pcre_uchar)(re->req_char);
-
3237 if ((re->flags & PCRE_RCH_CASELESS) != 0)
never evaluated: (re->flags & 0x0080) != 0
0
3238 { -
3239 req_char2 = TABLE_GET(req_char, md->tables + fcc_offset, req_char);
never evaluated: ((req_char) <= 255u)
0
3240#if defined SUPPORT_UCP && !(defined COMPILE_PCRE8) -
3241 if (utf && req_char > 127)
never evaluated: utf
never evaluated: req_char > 127
0
3242 req_char2 = UCD_OTHERCASE(req_char);
never executed: req_char2 = (req_char + (_pcre16_ucd_records + _pcre16_ucd_stage2[_pcre16_ucd_stage1[(req_char) / 128] * 128 + (req_char) % 128])->other_case);
0
3243#endif -
3244 }
never executed: }
0
3245 }
never executed: }
0
3246 -
3247/* Call the main matching function, looping for a non-anchored regex after a -
3248failed match. If not restarting, perform certain optimizations at the start of -
3249a match. */ -
3250 -
3251for (;;)
never executed (the execution status of this line is deduced): for (;;)
-
3252 { -
3253 int rc;
never executed (the execution status of this line is deduced): int rc;
-
3254 -
3255 if ((options & PCRE_DFA_RESTART) == 0)
never evaluated: (options & 0x00020000) == 0
0
3256 { -
3257 const pcre_uchar *save_end_subject = end_subject;
never executed (the execution status of this line is deduced): const pcre_uchar *save_end_subject = end_subject;
-
3258 -
3259 /* If firstline is TRUE, the start of the match is constrained to the first -
3260 line of a multiline string. Implement this by temporarily adjusting -
3261 end_subject so that we stop scanning at a newline. If the match fails at -
3262 the newline, later code breaks this loop. */ -
3263 -
3264 if (firstline)
never evaluated: firstline
0
3265 { -
3266 PCRE_PUCHAR t = current_subject;
never executed (the execution status of this line is deduced): const pcre_uchar * t = current_subject;
-
3267#ifdef SUPPORT_UTF -
3268 if (utf)
never evaluated: utf
0
3269 { -
3270 while (t < md->end_subject && !IS_NEWLINE(t))
never evaluated: t < md->end_subject
never evaluated: (md->nltype != 0)
0
3271 { -
3272 t++;
never executed (the execution status of this line is deduced): t++;
-
3273 ACROSSCHAR(t < end_subject, *t, t++);
never executed: t++;
never evaluated: (t < end_subject)
never evaluated: ((*t) & 0xfc00) == 0xdc00
0
3274 }
never executed: }
0
3275 }
never executed: }
0
3276 else -
3277#endif -
3278 while (t < md->end_subject && !IS_NEWLINE(t)) t++;
never executed: t++;
never evaluated: t < md->end_subject
never evaluated: (md->nltype != 0)
0
3279 end_subject = t;
never executed (the execution status of this line is deduced): end_subject = t;
-
3280 }
never executed: }
0
3281 -
3282 /* There are some optimizations that avoid running the match if a known -
3283 starting point is not found. However, there is an option that disables -
3284 these, for testing and for ensuring that all callouts do actually occur. -
3285 The option can be set in the regex by (*NO_START_OPT) or passed in -
3286 match-time options. */ -
3287 -
3288 if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0)
never evaluated: ((options | re->options) & 0x04000000) == 0
0
3289 { -
3290 /* Advance to a known first char. */ -
3291 -
3292 if (has_first_char)
never evaluated: has_first_char
0
3293 { -
3294 if (first_char != first_char2)
never evaluated: first_char != first_char2
0
3295 while (current_subject < end_subject &&
never evaluated: current_subject < end_subject
0
3296 *current_subject != first_char && *current_subject != first_char2)
never evaluated: *current_subject != first_char
never evaluated: *current_subject != first_char2
0
3297 current_subject++;
never executed: current_subject++;
0
3298 else -
3299 while (current_subject < end_subject &&
never evaluated: current_subject < end_subject
0
3300 *current_subject != first_char)
never evaluated: *current_subject != first_char
0
3301 current_subject++;
never executed: current_subject++;
0
3302 } -
3303 -
3304 /* Or to just after a linebreak for a multiline match if possible */ -
3305 -
3306 else if (startline)
never evaluated: startline
0
3307 { -
3308 if (current_subject > md->start_subject + start_offset)
never evaluated: current_subject > md->start_subject + start_offset
0
3309 { -
3310#ifdef SUPPORT_UTF -
3311 if (utf)
never evaluated: utf
0
3312 { -
3313 while (current_subject < end_subject &&
never evaluated: current_subject < end_subject
0
3314 !WAS_NEWLINE(current_subject))
never evaluated: (md->nltype != 0)
0
3315 { -
3316 current_subject++;
never executed (the execution status of this line is deduced): current_subject++;
-
3317 ACROSSCHAR(current_subject < end_subject, *current_subject,
never executed: current_subject++;
never evaluated: (current_subject < end_subject)
never evaluated: ((*current_subject) & 0xfc00) == 0xdc00
0
3318 current_subject++); -
3319 }
never executed: }
0
3320 }
never executed: }
0
3321 else -
3322#endif -
3323 while (current_subject < end_subject && !WAS_NEWLINE(current_subject))
never evaluated: current_subject < end_subject
never evaluated: (md->nltype != 0)
0
3324 current_subject++;
never executed: current_subject++;
0
3325 -
3326 /* If we have just passed a CR and the newline option is ANY or -
3327 ANYCRLF, and we are now at a LF, advance the match position by one -
3328 more character. */ -
3329 -
3330 if (current_subject[-1] == CHAR_CR &&
never evaluated: current_subject[-1] == '\015'
0
3331 (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&
never evaluated: md->nltype == 1
never evaluated: md->nltype == 2
0
3332 current_subject < end_subject &&
never evaluated: current_subject < end_subject
0
3333 *current_subject == CHAR_NL)
never evaluated: *current_subject == '\012'
0
3334 current_subject++;
never executed: current_subject++;
0
3335 }
never executed: }
0
3336 }
never executed: }
0
3337 -
3338 /* Or to a non-unique first char after study */ -
3339 -
3340 else if (start_bits != NULL)
never evaluated: start_bits != ((void *)0)
0
3341 { -
3342 while (current_subject < end_subject)
never evaluated: current_subject < end_subject
0
3343 { -
3344 register unsigned int c = *current_subject;
never executed (the execution status of this line is deduced): register unsigned int c = *current_subject;
-
3345#ifndef COMPILE_PCRE8 -
3346 if (c > 255) c = 255;
never executed: c = 255;
never evaluated: c > 255
0
3347#endif -
3348 if ((start_bits[c/8] & (1 << (c&7))) == 0)
never evaluated: (start_bits[c/8] & (1 << (c&7))) == 0
0
3349 { -
3350 current_subject++;
never executed (the execution status of this line is deduced): current_subject++;
-
3351#if defined SUPPORT_UTF && defined COMPILE_PCRE8 -
3352 /* In non 8-bit mode, the iteration will stop for -
3353 characters > 255 at the beginning or not stop at all. */ -
3354 if (utf) -
3355 ACROSSCHAR(current_subject < end_subject, *current_subject, -
3356 current_subject++); -
3357#endif -
3358 }
never executed: }
0
3359 else break;
never executed: break;
0
3360 } -
3361 }
never executed: }
0
3362 } -
3363 -
3364 /* Restore fudged end_subject */ -
3365 -
3366 end_subject = save_end_subject;
never executed (the execution status of this line is deduced): end_subject = save_end_subject;
-
3367 -
3368 /* The following two optimizations are disabled for partial matching or if -
3369 disabling is explicitly requested (and of course, by the test above, this -
3370 code is not obeyed when restarting after a partial match). */ -
3371 -
3372 if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0 &&
never evaluated: ((options | re->options) & 0x04000000) == 0
0
3373 (options & (PCRE_PARTIAL_HARD|PCRE_PARTIAL_SOFT)) == 0)
never evaluated: (options & (0x08000000|0x00008000)) == 0
0
3374 { -
3375 /* If the pattern was studied, a minimum subject length may be set. This -
3376 is a lower bound; no actual string of that length may actually match the -
3377 pattern. Although the value is, strictly, in characters, we treat it as -
3378 bytes to avoid spending too much time in this optimization. */ -
3379 -
3380 if (study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0 &&
never evaluated: study != ((void *)0)
never evaluated: (study->flags & 0x0002) != 0
0
3381 (pcre_uint32)(end_subject - current_subject) < study->minlength)
never evaluated: (pcre_uint32)(end_subject - current_subject) < study->minlength
0
3382 return PCRE_ERROR_NOMATCH;
never executed: return (-1);
0
3383 -
3384 /* If req_char is set, we know that that character must appear in the -
3385 subject for the match to succeed. If the first character is set, req_char -
3386 must be later in the subject; otherwise the test starts at the match -
3387 point. This optimization can save a huge amount of work in patterns with -
3388 nested unlimited repeats that aren't going to match. Writing separate -
3389 code for cased/caseless versions makes it go faster, as does using an -
3390 autoincrement and backing off on a match. -
3391 -
3392 HOWEVER: when the subject string is very, very long, searching to its end -
3393 can take a long time, and give bad performance on quite ordinary -
3394 patterns. This showed up when somebody was matching /^C/ on a 32-megabyte -
3395 string... so we don't do this when the string is sufficiently long. */ -
3396 -
3397 if (has_req_char && end_subject - current_subject < REQ_BYTE_MAX)
never evaluated: has_req_char
never evaluated: end_subject - current_subject < 1000
0
3398 { -
3399 register PCRE_PUCHAR p = current_subject + (has_first_char? 1:0);
never evaluated: has_first_char
0
3400 -
3401 /* We don't need to repeat the search if we haven't yet reached the -
3402 place we found it at last time. */ -
3403 -
3404 if (p > req_char_ptr)
never evaluated: p > req_char_ptr
0
3405 { -
3406 if (req_char != req_char2)
never evaluated: req_char != req_char2
0
3407 { -
3408 while (p < end_subject)
never evaluated: p < end_subject
0
3409 { -
3410 register int pp = *p++;
never executed (the execution status of this line is deduced): register int pp = *p++;
-
3411 if (pp == req_char || pp == req_char2) { p--; break; }
never executed: break;
never evaluated: pp == req_char
never evaluated: pp == req_char2
0
3412 }
never executed: }
0
3413 }
never executed: }
0
3414 else -
3415 { -
3416 while (p < end_subject)
never evaluated: p < end_subject
0
3417 { -
3418 if (*p++ == req_char) { p--; break; }
never executed: break;
never evaluated: *p++ == req_char
0
3419 }
never executed: }
0
3420 }
never executed: }
0
3421 -
3422 /* If we can't find the required character, break the matching loop, -
3423 which will cause a return or PCRE_ERROR_NOMATCH. */ -
3424 -
3425 if (p >= end_subject) break;
never executed: break;
never evaluated: p >= end_subject
0
3426 -
3427 /* If we have found the required character, save the point where we -
3428 found it, so that we don't search again next time round the loop if -
3429 the start hasn't passed this character yet. */ -
3430 -
3431 req_char_ptr = p;
never executed (the execution status of this line is deduced): req_char_ptr = p;
-
3432 }
never executed: }
0
3433 }
never executed: }
0
3434 }
never executed: }
0
3435 } /* End of optimizations that are done when not restarting */
never executed: }
0
3436 -
3437 /* OK, now we can do the business */ -
3438 -
3439 md->start_used_ptr = current_subject;
never executed (the execution status of this line is deduced): md->start_used_ptr = current_subject;
-
3440 md->recursive = NULL;
never executed (the execution status of this line is deduced): md->recursive = ((void *)0);
-
3441 -
3442 rc = internal_dfa_exec(
never executed (the execution status of this line is deduced): rc = internal_dfa_exec(
-
3443 md, /* fixed match data */
never executed (the execution status of this line is deduced): md,
-
3444 md->start_code, /* this subexpression's code */
never executed (the execution status of this line is deduced): md->start_code,
-
3445 current_subject, /* where we currently are */
never executed (the execution status of this line is deduced): current_subject,
-
3446 start_offset, /* start offset in subject */
never executed (the execution status of this line is deduced): start_offset,
-
3447 offsets, /* offset vector */
never executed (the execution status of this line is deduced): offsets,
-
3448 offsetcount, /* size of same */
never executed (the execution status of this line is deduced): offsetcount,
-
3449 workspace, /* workspace vector */
never executed (the execution status of this line is deduced): workspace,
-
3450 wscount, /* size of same */
never executed (the execution status of this line is deduced): wscount,
-
3451 0); /* function recurse level */
never executed (the execution status of this line is deduced): 0);
-
3452 -
3453 /* Anything other than "no match" means we are done, always; otherwise, carry -
3454 on only if not anchored. */ -
3455 -
3456 if (rc != PCRE_ERROR_NOMATCH || anchored) return rc;
never executed: return rc;
never evaluated: rc != (-1)
never evaluated: anchored
0
3457 -
3458 /* Advance to the next subject character unless we are at the end of a line -
3459 and firstline is set. */ -
3460 -
3461 if (firstline && IS_NEWLINE(current_subject)) break;
never executed: break;
never evaluated: firstline
never evaluated: (md->nltype != 0)
0
3462 current_subject++;
never executed (the execution status of this line is deduced): current_subject++;
-
3463#ifdef SUPPORT_UTF -
3464 if (utf)
never evaluated: utf
0
3465 { -
3466 ACROSSCHAR(current_subject < end_subject, *current_subject,
never executed: current_subject++;
never evaluated: (current_subject < end_subject)
never evaluated: ((*current_subject) & 0xfc00) == 0xdc00
0
3467 current_subject++); -
3468 }
never executed: }
0
3469#endif -
3470 if (current_subject > end_subject) break;
never executed: break;
never evaluated: current_subject > end_subject
0
3471 -
3472 /* If we have just passed a CR and we are now at a LF, and the pattern does -
3473 not contain any explicit matches for \r or \n, and the newline option is CRLF -
3474 or ANY or ANYCRLF, advance the match position by one more character. */ -
3475 -
3476 if (current_subject[-1] == CHAR_CR &&
never evaluated: current_subject[-1] == '\015'
0
3477 current_subject < end_subject &&
never evaluated: current_subject < end_subject
0
3478 *current_subject == CHAR_NL &&
never evaluated: *current_subject == '\012'
0
3479 (re->flags & PCRE_HASCRORLF) == 0 &&
never evaluated: (re->flags & 0x0800) == 0
0
3480 (md->nltype == NLTYPE_ANY ||
never evaluated: md->nltype == 1
0
3481 md->nltype == NLTYPE_ANYCRLF ||
never evaluated: md->nltype == 2
0
3482 md->nllen == 2))
never evaluated: md->nllen == 2
0
3483 current_subject++;
never executed: current_subject++;
0
3484 -
3485 } /* "Bumpalong" loop */
never executed: }
0
3486 -
3487return PCRE_ERROR_NOMATCH;
never executed: return (-1);
0
3488} -
3489 -
3490/* End of pcre_dfa_exec.c */ -
3491 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial