line |
true |
false |
branch |
228
|
0 |
0 |
if (eflags & ~(REG_NOTBOL | REG_NOTEOL | REG_STARTEND)) |
231
|
0 |
0 |
if (eflags & REG_STARTEND) |
243
|
0 |
0 |
if (preg->no_sub) |
355
|
0 |
0 |
if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1 || DO_UTF8(sv1) != DO_UTF8(sv2), 0)) |
|
0 |
0 |
if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1 || DO_UTF8(sv1) != DO_UTF8(sv2), 0)) |
|
0 |
0 |
if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1 || DO_UTF8(sv1) != DO_UTF8(sv2), 0)) |
|
0 |
0 |
if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1 || DO_UTF8(sv1) != DO_UTF8(sv2), 0)) |
|
0 |
0 |
if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1 || DO_UTF8(sv1) != DO_UTF8(sv2), 0)) |
|
0 |
0 |
if (BE (length1 < 0 || length2 < 0 || stop < 0 || len < length1 || DO_UTF8(sv1) != DO_UTF8(sv2), 0)) |
359
|
0 |
0 |
if (length2 > 0) |
360
|
0 |
0 |
if (length1 > 0) |
383
|
0 |
0 |
re_free (s); |
407
|
0 |
14 |
if (BE (start < 0 || start > length, 0)) |
409
|
14 |
0 |
if (BE (length < last_start || (0 <= range && last_start < start), 0)) |
|
14 |
0 |
if (BE (length < last_start || (0 <= range && last_start < start), 0)) |
|
0 |
14 |
if (BE (length < last_start || (0 <= range && last_start < start), 0)) |
|
0 |
14 |
if (BE (length < last_start || (0 <= range && last_start < start), 0)) |
411
|
0 |
14 |
else if (BE (last_start < 0 || (range < 0 && start <= last_start), 0)) |
|
0 |
0 |
else if (BE (last_start < 0 || (range < 0 && start <= last_start), 0)) |
417
|
0 |
14 |
eflags |= (bufp->not_eol) ? REG_NOTEOL : 0; |
420
|
14 |
0 |
if (start < last_start && bufp->fastmap != NULL && !bufp->fastmap_accurate) |
|
0 |
14 |
if (start < last_start && bufp->fastmap != NULL && !bufp->fastmap_accurate) |
|
0 |
0 |
if (start < last_start && bufp->fastmap != NULL && !bufp->fastmap_accurate) |
423
|
0 |
14 |
if (BE (bufp->no_sub, 0)) |
427
|
0 |
14 |
if (regs == NULL) |
429
|
0 |
14 |
else if (BE (bufp->regs_allocated == REGS_FIXED |
|
0 |
0 |
else if (BE (bufp->regs_allocated == REGS_FIXED |
433
|
0 |
0 |
if (BE (nregs < 1, 0)) |
443
|
0 |
14 |
re_malloc (pmatch, regmatch_t, nregs); |
450
|
2 |
12 |
if (result != REG_NOERROR) |
451
|
2 |
0 |
rval = result == REG_NOMATCH ? -1 : -2; |
452
|
12 |
0 |
else if (regs != NULL) |
457
|
0 |
12 |
if (BE (bufp->regs_allocated == REGS_UNALLOCATED, 0)) |
461
|
12 |
2 |
if (BE (rval == 0, 1)) |
463
|
0 |
12 |
if (ret_len) |
471
|
14 |
0 |
re_free (pmatch); |
488
|
5 |
7 |
if (regs_allocated == REGS_UNALLOCATED) |
490
|
0 |
5 |
re_malloc (regs->start, regoff_t, need_regs); |
491
|
0 |
5 |
re_malloc (regs->end, regoff_t, need_regs); |
494
|
7 |
0 |
else if (regs_allocated == REGS_REALLOCATE) |
498
|
7 |
0 |
if (BE (need_regs > regs->num_regs, 0)) |
500
|
0 |
7 |
re_realloc (regs->start, regoff_t, need_regs); |
501
|
0 |
7 |
re_realloc (regs->end, regoff_t, need_regs); |
514
|
25 |
12 |
for (i = 0; i < nregs; ++i) |
519
|
12 |
12 |
for ( ; i < regs->num_regs; ++i) |
541
|
0 |
0 |
if (num_regs) |
609
|
0 |
0 |
char *fastmap = ((preg->fastmap != NULL && preg->fastmap_accurate |
610
|
0 |
0 |
&& start != last_start && !preg->can_be_null) |
|
0 |
0 |
&& start != last_start && !preg->can_be_null) |
611
|
0 |
14 |
? preg->fastmap : NULL); |
622
|
14 |
0 |
extra_nmatch = (nmatch > preg->re_nsub) ? nmatch - (preg->re_nsub + 1) : 0; |
626
|
14 |
0 |
if (BE (preg->used == 0 || dfa->init_state == NULL |
|
0 |
14 |
if (BE (preg->used == 0 || dfa->init_state == NULL |
|
14 |
0 |
if (BE (preg->used == 0 || dfa->init_state == NULL |
|
0 |
14 |
if (BE (preg->used == 0 || dfa->init_state == NULL |
|
14 |
0 |
if (BE (preg->used == 0 || dfa->init_state == NULL |
|
0 |
14 |
if (BE (preg->used == 0 || dfa->init_state == NULL |
|
14 |
0 |
if (BE (preg->used == 0 || dfa->init_state == NULL |
|
0 |
14 |
if (BE (preg->used == 0 || dfa->init_state == NULL |
639
|
0 |
14 |
if (dfa->init_state->nodes.nelem == 0 |
640
|
0 |
0 |
&& dfa->init_state_word->nodes.nelem == 0 |
641
|
0 |
0 |
&& (dfa->init_state_nl->nodes.nelem == 0 |
642
|
0 |
0 |
|| !preg->newline_anchor)) |
644
|
0 |
0 |
if (start != 0 && last_start != 0) |
|
0 |
0 |
if (start != 0 && last_start != 0) |
650
|
0 |
14 |
fl_longest_match = (nmatch != 0 || dfa->nbackref); |
|
0 |
0 |
fl_longest_match = (nmatch != 0 || dfa->nbackref); |
655
|
0 |
14 |
if (BE (err != REG_NOERROR, 0)) |
662
|
0 |
14 |
if (BE (err != REG_NOERROR, 0)) |
669
|
1 |
13 |
if (nmatch > 1 || dfa->has_mb_node) |
|
0 |
1 |
if (nmatch > 1 || dfa->has_mb_node) |
672
|
0 |
13 |
if (BE ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) |
679
|
0 |
13 |
re_malloc (mctx.state_log, re_dfastate_t *, mctx.input.bufs_len + 1); |
685
|
0 |
14 |
mctx.input.tip_context = (eflags & REG_NOTBOL) ? CONTEXT_BEGBUF |
689
|
0 |
14 |
incr = (last_start < start) ? -1 : 1; |
695
|
0 |
0 |
? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0) |
|
0 |
0 |
? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0) |
|
0 |
0 |
? ((sb || !(preg->syntax & RE_ICASE || t) ? 4 : 0) |
696
|
0 |
0 |
| (start <= last_start ? 2 : 0) |
698
|
0 |
14 |
: 8); |
703
|
53 |
0 |
if (match_first < left_lim || right_lim < match_first) |
|
51 |
2 |
if (match_first < left_lim || right_lim < match_first) |
719
|
0 |
0 |
while (BE (match_first < right_lim, 1) |
720
|
0 |
0 |
&& !fastmap[t[(unsigned char) string[match_first]]]) |
726
|
0 |
0 |
while (BE (match_first < right_lim, 1) |
727
|
0 |
0 |
&& !fastmap[(unsigned char) string[match_first]]) |
731
|
0 |
0 |
if (BE (match_first == right_lim, 0)) |
734
|
0 |
0 |
? 0 : (unsigned char) string[match_first]; |
735
|
0 |
0 |
if (!fastmap[t ? t[ch] : ch]) |
|
0 |
0 |
if (!fastmap[t ? t[ch] : ch]) |
743
|
0 |
0 |
while (match_first >= left_lim) |
746
|
0 |
0 |
? 0 : (unsigned char) string[match_first]; |
747
|
0 |
0 |
if (fastmap[t ? t[ch] : ch]) |
|
0 |
0 |
if (fastmap[t ? t[ch] : ch]) |
751
|
0 |
0 |
if (match_first < left_lim) |
764
|
0 |
0 |
if (BE (offset >= (__re_size_t) mctx.input.valid_raw_len, 0)) |
768
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
776
|
0 |
0 |
? 0 : re_string_byte_at (&mctx.input, offset)); |
777
|
0 |
0 |
if (fastmap[ch]) |
780
|
0 |
0 |
if (match_first < left_lim || match_first > right_lim) |
|
0 |
0 |
if (match_first < left_lim || match_first > right_lim) |
792
|
0 |
51 |
if (BE (err != REG_NOERROR, 0)) |
798
|
51 |
0 |
if (!sb && !re_string_first_byte (&mctx.input, 0)) |
|
49 |
2 |
if (!sb && !re_string_first_byte (&mctx.input, 0)) |
|
16 |
33 |
if (!sb && !re_string_first_byte (&mctx.input, 0)) |
805
|
35 |
0 |
match_last = check_matching (aTHX_ &mctx, fl_longest_match, |
807
|
12 |
23 |
if (match_last != REG_MISSING) |
809
|
0 |
12 |
if (BE (match_last == REG_ERROR, 0)) |
817
|
12 |
0 |
if ((!preg->no_sub && nmatch > 1) || dfa->nbackref) |
|
0 |
12 |
if ((!preg->no_sub && nmatch > 1) || dfa->nbackref) |
|
0 |
0 |
if ((!preg->no_sub && nmatch > 1) || dfa->nbackref) |
823
|
12 |
0 |
if ((!preg->no_sub && nmatch > 1 && dfa->has_plural_match) |
|
12 |
0 |
if ((!preg->no_sub && nmatch > 1 && dfa->has_plural_match) |
|
3 |
9 |
if ((!preg->no_sub && nmatch > 1 && dfa->has_plural_match) |
824
|
0 |
3 |
|| dfa->nbackref) |
827
|
9 |
0 |
if (err == REG_NOERROR) |
829
|
0 |
0 |
if (BE (err != REG_NOMATCH, 0)) |
847
|
12 |
0 |
if (nmatch > 0) |
852
|
13 |
12 |
for (reg_idx = 1; reg_idx < nmatch; ++reg_idx) |
862
|
12 |
0 |
if (!preg->no_sub && nmatch > 1) |
|
12 |
0 |
if (!preg->no_sub && nmatch > 1) |
865
|
9 |
3 |
dfa->has_plural_match && dfa->nbackref > 0); |
|
0 |
9 |
dfa->has_plural_match && dfa->nbackref > 0); |
866
|
0 |
12 |
if (BE (err != REG_NOERROR, 0)) |
873
|
25 |
12 |
for (reg_idx = 0; reg_idx < nmatch; ++reg_idx) |
874
|
25 |
0 |
if (pmatch[reg_idx].rm_so != -1) |
877
|
0 |
25 |
if (BE (mctx.input.offsets_needed != 0, 0)) |
879
|
0 |
0 |
pmatch[reg_idx].rm_so = |
883
|
0 |
0 |
pmatch[reg_idx].rm_eo = |
894
|
0 |
12 |
for (reg_idx = 0; reg_idx < extra_nmatch; ++reg_idx) |
900
|
0 |
12 |
if (dfa->subexp_map) |
901
|
0 |
0 |
for (reg_idx = 0; reg_idx + 1 < nmatch; reg_idx++) |
902
|
0 |
0 |
if (dfa->subexp_map[reg_idx] != reg_idx) |
912
|
13 |
1 |
re_free (mctx.state_log); |
913
|
0 |
14 |
if (dfa->nbackref) |
936
|
0 |
9 |
if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) <= match_last, 0)) |
939
|
0 |
9 |
re_malloc (sifted_states, re_dfastate_t *, match_last + 1); |
940
|
0 |
9 |
if (dfa->nbackref) |
942
|
0 |
0 |
re_malloc (lim_states, re_dfastate_t *, match_last + 1); |
950
|
0 |
0 |
re_node_set_free (&sctx.limits); |
951
|
0 |
0 |
if (BE (ret != REG_NOERROR, 0)) |
953
|
0 |
0 |
if (sifted_states[0] != NULL || lim_states[0] != NULL) |
|
0 |
0 |
if (sifted_states[0] != NULL || lim_states[0] != NULL) |
958
|
0 |
0 |
if (! REG_VALID_INDEX (match_last)) |
964
|
0 |
0 |
|| !mctx->state_log[match_last]->halt); |
|
0 |
0 |
|| !mctx->state_log[match_last]->halt); |
971
|
0 |
0 |
re_free (lim_states); |
973
|
0 |
0 |
if (BE (ret != REG_NOERROR, 0)) |
980
|
0 |
9 |
re_node_set_free (&sctx.limits); |
981
|
0 |
9 |
if (BE (ret != REG_NOERROR, 0)) |
983
|
0 |
9 |
if (sifted_states[0] == NULL) |
989
|
9 |
0 |
re_free (mctx->state_log); |
996
|
0 |
9 |
re_free (sifted_states); |
997
|
0 |
9 |
re_free (lim_states); |
1011
|
0 |
35 |
if (dfa->init_state->has_constraint) |
1015
|
0 |
0 |
if (IS_WORD_CONTEXT (context)) |
1017
|
0 |
0 |
else if (IS_ORDINARY_CONTEXT (context)) |
1019
|
0 |
0 |
else if (IS_BEGBUF_CONTEXT (context) && IS_NEWLINE_CONTEXT (context)) |
|
0 |
0 |
else if (IS_BEGBUF_CONTEXT (context) && IS_NEWLINE_CONTEXT (context)) |
1021
|
0 |
0 |
else if (IS_NEWLINE_CONTEXT (context)) |
1023
|
0 |
0 |
else if (IS_BEGBUF_CONTEXT (context)) |
1064
|
0 |
35 |
if (BE (cur_state == NULL, 0)) |
1070
|
21 |
14 |
if (mctx->state_log != NULL) |
1076
|
0 |
21 |
if (BE (dfa->nbackref, 0)) |
1080
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1083
|
0 |
0 |
if (cur_state->has_backref) |
1086
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1093
|
0 |
35 |
if (BE (cur_state->halt, 0)) |
1095
|
0 |
0 |
if (!cur_state->has_constraint |
1096
|
0 |
0 |
|| check_halt_state_context (aTHX_ mctx, cur_state, cur_str_idx)) |
1098
|
0 |
0 |
if (!fl_longest_match) |
1108
|
61 |
5 |
while (!re_string_eoi (&mctx->input)) |
1113
|
0 |
61 |
if ((BE (next_char_idx >= mctx->input.bufs_len, 0) |
1114
|
0 |
0 |
&& mctx->input.bufs_len < mctx->input.len) |
1115
|
7 |
54 |
|| (BE (next_char_idx >= mctx->input.valid_len, 0) |
1116
|
0 |
7 |
&& mctx->input.valid_len < mctx->input.len)) |
1119
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1127
|
46 |
15 |
if (mctx->state_log != NULL) |
1130
|
46 |
15 |
if (cur_state == NULL) |
1135
|
0 |
46 |
if (BE (err != REG_NOERROR, 0)) |
1138
|
33 |
13 |
if (mctx->state_log == NULL |
1139
|
9 |
24 |
|| (match && !fl_longest_match) |
|
9 |
0 |
|| (match && !fl_longest_match) |
1140
|
16 |
17 |
|| (cur_state = find_recover_state (aTHX_ &err, mctx)) == NULL) |
1144
|
21 |
10 |
if (BE (at_init_state, 0)) |
1146
|
0 |
21 |
if (old_state == cur_state) |
1152
|
12 |
19 |
if (cur_state->halt) |
1156
|
0 |
12 |
if (!cur_state->has_constraint |
1157
|
0 |
0 |
|| check_halt_state_context (aTHX_ mctx, cur_state, |
1166
|
0 |
12 |
if (!fl_longest_match) |
1172
|
23 |
12 |
if (p_match_first) |
1186
|
9 |
12 |
if (type != END_OF_RE) |
1188
|
12 |
0 |
if (!constraint) |
1190
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (constraint, context)) |
1210
|
21 |
0 |
for (i = 0; i < state->nodes.nelem; ++i) |
1211
|
12 |
9 |
if (check_halt_node_context (aTHX_ mctx->dfa, state->nodes.elems[i], context)) |
1230
|
35 |
22 |
if (IS_EPSILON_NODE (dfa->nodes[node].type)) |
1236
|
0 |
35 |
if (BE (! ok, 0)) |
1240
|
44 |
35 |
for (dest_node = REG_MISSING, i = 0; i < edests->nelem; ++i) |
1243
|
9 |
35 |
if (!re_node_set_contains (aTHX_ cur_nodes, candidate)) |
1245
|
35 |
0 |
if (dest_node == REG_MISSING) |
1252
|
0 |
0 |
if (re_node_set_contains (aTHX_ eps_via_nodes, dest_node)) |
1256
|
0 |
0 |
else if (fs != NULL |
1257
|
0 |
0 |
&& push_fail_stack (aTHX_ fs, *pidx, candidate, nregs, regs, |
1273
|
9 |
13 |
if (dfa->nodes[node].accept_mb) |
1277
|
0 |
13 |
if (type == OP_BACK_REF) |
1281
|
0 |
0 |
if (fs != NULL) |
1283
|
0 |
0 |
if (regs[subexp_idx].rm_so == -1 || regs[subexp_idx].rm_eo == -1) |
|
0 |
0 |
if (regs[subexp_idx].rm_so == -1 || regs[subexp_idx].rm_eo == -1) |
1285
|
0 |
0 |
else if (naccepted) |
1288
|
0 |
0 |
if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx, |
1294
|
0 |
0 |
if (naccepted == 0) |
1298
|
0 |
0 |
if (BE (! ok, 0)) |
1301
|
0 |
0 |
if (re_node_set_contains (aTHX_ &mctx->state_log[*pidx]->nodes, |
1307
|
13 |
9 |
if (naccepted != 0 |
1308
|
13 |
0 |
|| check_node_accept (aTHX_ mctx, dfa->nodes + node, *pidx)) |
1311
|
13 |
9 |
*pidx = (naccepted == 0) ? *pidx + 1 : *pidx + naccepted; |
1312
|
0 |
22 |
if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == NULL |
|
0 |
0 |
if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == NULL |
|
0 |
0 |
if (fs && (*pidx > mctx->match_last || mctx->state_log[*pidx] == NULL |
1313
|
0 |
0 |
|| !re_node_set_contains (aTHX_ &mctx->state_log[*pidx]->nodes, |
1330
|
0 |
0 |
if (fs->num == fs->alloc) |
1333
|
0 |
0 |
Renew(fs->stack, (sizeof (struct re_fail_stack_ent_t) * fs->alloc * 2), struct re_fail_stack_ent_t); |
1338
|
0 |
0 |
re_malloc (fs->stack[num].regs, regmatch_t, nregs); |
1339
|
0 |
0 |
Copy (regs, fs->stack[num].regs, nregs, regmatch_t); |
1352
|
0 |
0 |
Copy (fs->stack[num].regs, regs, nregs, regmatch_t); |
1353
|
0 |
0 |
re_node_set_free (eps_via_nodes); |
1354
|
0 |
0 |
re_free (fs->stack[num].regs); |
1381
|
0 |
12 |
if (fl_backtrack) |
1384
|
0 |
0 |
re_malloc (fs->stack, struct re_fail_stack_ent_t, fs->alloc); |
1396
|
0 |
12 |
re_malloc (prev_idx_match, regmatch_t, nmatch); |
1399
|
0 |
12 |
Copy (pmatch, prev_idx_match, nmatch, regmatch_t); |
1401
|
69 |
0 |
for (idx = (Idx)pmatch[0].rm_so; idx <= (Idx)pmatch[0].rm_eo ;) |
1405
|
21 |
48 |
if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node) |
|
12 |
9 |
if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node) |
1408
|
0 |
12 |
if (fs) |
1410
|
0 |
0 |
for (reg_idx = 0; reg_idx < nmatch; ++reg_idx) |
1411
|
0 |
0 |
if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1) |
|
0 |
0 |
if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1) |
1413
|
0 |
0 |
if (reg_idx == nmatch) |
1415
|
0 |
0 |
re_node_set_free (&eps_via_nodes); |
1416
|
0 |
0 |
if (prev_idx_match_malloced) |
1417
|
0 |
0 |
re_free (prev_idx_match); |
1425
|
12 |
0 |
re_node_set_free (&eps_via_nodes); |
1426
|
12 |
0 |
if (prev_idx_match_malloced) |
1427
|
12 |
0 |
re_free (prev_idx_match); |
1436
|
0 |
57 |
if (BE (! REG_VALID_INDEX (cur_node), 0)) |
1438
|
0 |
0 |
if (BE (cur_node == REG_ERROR, 0)) |
1440
|
0 |
0 |
re_node_set_free (&eps_via_nodes); |
1441
|
0 |
0 |
if (prev_idx_match_malloced) |
1442
|
0 |
0 |
re_free (prev_idx_match); |
1446
|
0 |
0 |
if (fs) |
1451
|
0 |
0 |
re_node_set_free (&eps_via_nodes); |
1452
|
0 |
0 |
if (prev_idx_match_malloced) |
1453
|
0 |
0 |
re_free (prev_idx_match); |
1458
|
0 |
0 |
re_node_set_free (&eps_via_nodes); |
1459
|
0 |
0 |
if (prev_idx_match_malloced) |
1460
|
0 |
0 |
re_free (prev_idx_match); |
1468
|
0 |
0 |
if (fs) |
1471
|
0 |
0 |
for (fs_idx = 0; fs_idx < fs->num; ++fs_idx) |
1473
|
0 |
0 |
re_node_set_free (&fs->stack[fs_idx].eps_via_nodes); |
1474
|
0 |
0 |
re_free (fs->stack[fs_idx].regs); |
1476
|
0 |
0 |
re_free (fs->stack); |
1487
|
13 |
56 |
if (type == OP_OPEN_SUBEXP) |
1492
|
13 |
0 |
if (reg_num < nmatch) |
1498
|
13 |
43 |
else if (type == OP_CLOSE_SUBEXP) |
1501
|
13 |
0 |
if (reg_num < nmatch) |
1504
|
13 |
0 |
if ((Idx)pmatch[reg_num].rm_so < cur_idx) |
1509
|
0 |
13 |
Copy (pmatch, prev_idx_match, nmatch, regmatch_t); |
1513
|
0 |
0 |
if (dfa->nodes[cur_node].opt_subexp |
1514
|
0 |
0 |
&& prev_idx_match[reg_num].rm_so != -1) |
1520
|
0 |
0 |
Copy (prev_idx_match, pmatch, nmatch, regmatch_t); |
1569
|
0 |
9 |
if (BE (err != REG_NOERROR, 0)) |
1572
|
0 |
9 |
if (BE (err != REG_NOERROR, 0)) |
1576
|
28 |
9 |
while (str_idx > 0) |
1579
|
18 |
10 |
null_cnt = (sctx->sifted_states[str_idx] == NULL) ? null_cnt + 1 : 0; |
1580
|
0 |
28 |
if (null_cnt > mctx->max_mb_elem_len) |
1584
|
0 |
0 |
re_node_set_free (&cur_dest); |
1590
|
10 |
18 |
if (mctx->state_log[str_idx]) |
1593
|
0 |
10 |
if (BE (err != REG_NOERROR, 0)) |
1602
|
0 |
28 |
if (BE (err != REG_NOERROR, 0)) |
1607
|
9 |
0 |
re_node_set_free (&cur_dest); |
1627
|
19 |
10 |
for (i = 0; i < cur_src->nelem; i++) |
1639
|
9 |
10 |
if (dfa->nodes[prev_node].accept_mb) |
1646
|
10 |
9 |
if (!naccepted |
1647
|
1 |
9 |
&& check_node_accept (aTHX_ mctx, dfa->nodes + prev_node, str_idx) |
1648
|
1 |
0 |
&& STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + 1], |
|
1 |
0 |
&& STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + 1], |
1652
|
9 |
10 |
if (naccepted == 0) |
1655
|
0 |
10 |
if (sctx->limits.nelem) |
1658
|
0 |
0 |
if (check_dst_limits (aTHX_ mctx, &sctx->limits, |
1664
|
0 |
10 |
if (BE (! ok, 0)) |
1679
|
0 |
16 |
if ((next_state_log_idx >= mctx->input.bufs_len |
1680
|
0 |
0 |
&& mctx->input.bufs_len < mctx->input.len) |
1681
|
0 |
16 |
|| (next_state_log_idx >= mctx->input.valid_len |
1682
|
0 |
0 |
&& mctx->input.valid_len < mctx->input.len)) |
1686
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1690
|
16 |
0 |
if (top < next_state_log_idx) |
1706
|
0 |
0 |
for (st_idx = 0; st_idx < num; ++st_idx) |
1708
|
0 |
0 |
if (dst[st_idx] == NULL) |
1710
|
0 |
0 |
else if (src[st_idx] != NULL) |
1715
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1718
|
0 |
0 |
re_node_set_free (&merged_set); |
1719
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1736
|
19 |
18 |
: &mctx->state_log[str_idx]->nodes); |
1738
|
18 |
19 |
if (dest_nodes->nelem == 0) |
1742
|
19 |
0 |
if (candidates) |
1747
|
0 |
19 |
if (BE (err != REG_NOERROR, 0)) |
1751
|
0 |
19 |
if (sctx->limits.nelem) |
1755
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1761
|
0 |
19 |
if (BE (err != REG_NOERROR, 0)) |
1765
|
19 |
18 |
if (candidates && mctx->state_log[str_idx]->has_backref) |
|
0 |
19 |
if (candidates && mctx->state_log[str_idx]->has_backref) |
1768
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1783
|
0 |
19 |
if (BE (err != REG_NOERROR, 0)) |
1786
|
5 |
14 |
if (!state->inveclosure.alloc) |
1789
|
0 |
5 |
if (BE (err != REG_NOERROR, 0)) |
1791
|
5 |
5 |
for (i = 0; i < dest_nodes->nelem; i++) |
1795
|
0 |
5 |
if (BE (err != REG_NOERROR, 0)) |
1813
|
0 |
0 |
for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx) |
1816
|
0 |
0 |
if (cur_node == node) |
1818
|
0 |
0 |
if (IS_EPSILON_NODE (dfa->nodes[cur_node].type)) |
1822
|
0 |
0 |
? dfa->edests[cur_node].elems[1] : REG_MISSING); |
1823
|
0 |
0 |
if ((!re_node_set_contains (aTHX_ inv_eclosure, edst1) |
1824
|
0 |
0 |
&& re_node_set_contains (aTHX_ dest_nodes, edst1)) |
1825
|
0 |
0 |
|| (REG_VALID_NONZERO_INDEX (edst2) |
1826
|
0 |
0 |
&& !re_node_set_contains (aTHX_ inv_eclosure, edst2) |
1827
|
0 |
0 |
&& re_node_set_contains (aTHX_ dest_nodes, edst2))) |
1831
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
1833
|
0 |
0 |
re_node_set_free (&except_nodes); |
1839
|
0 |
0 |
for (ecl_idx = 0; ecl_idx < inv_eclosure->nelem; ++ecl_idx) |
1842
|
0 |
0 |
if (!re_node_set_contains (aTHX_ &except_nodes, cur_node)) |
1848
|
0 |
0 |
re_node_set_free (&except_nodes); |
1862
|
0 |
0 |
for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx) |
1880
|
0 |
0 |
if (src_pos == dst_pos) |
1899
|
0 |
0 |
for (node_idx = 0; node_idx < eclosures->nelem; ++node_idx) |
1905
|
0 |
0 |
if (bkref_idx != REG_MISSING) |
1913
|
0 |
0 |
if (ent->node != node) |
1916
|
0 |
0 |
if (subexp_idx < BITSET_WORD_BITS |
1917
|
0 |
0 |
&& !(ent->eps_reachable_subexps_map |
1928
|
0 |
0 |
if (dst == from_node) |
1930
|
0 |
0 |
if (boundaries & 1) |
1939
|
0 |
0 |
if (cpos == -1 /* && (boundaries & 1) */) |
1941
|
0 |
0 |
if (cpos == 0 && (boundaries & 2)) |
|
0 |
0 |
if (cpos == 0 && (boundaries & 2)) |
1944
|
0 |
0 |
if (subexp_idx < BITSET_WORD_BITS) |
1948
|
0 |
0 |
while (ent++->more); |
1953
|
0 |
0 |
if ((boundaries & 1) && subexp_idx == dfa->nodes[node].opr.idx) |
|
0 |
0 |
if ((boundaries & 1) && subexp_idx == dfa->nodes[node].opr.idx) |
1958
|
0 |
0 |
if ((boundaries & 2) && subexp_idx == dfa->nodes[node].opr.idx) |
|
0 |
0 |
if ((boundaries & 2) && subexp_idx == dfa->nodes[node].opr.idx) |
1980
|
0 |
0 |
if (str_idx < lim->subexp_from) |
1983
|
0 |
0 |
if (lim->subexp_to < str_idx) |
1988
|
0 |
0 |
boundaries |= (str_idx == lim->subexp_to) << 1; |
1989
|
0 |
0 |
if (boundaries == 0) |
2009
|
0 |
0 |
for (lim_idx = 0; lim_idx < limits->nelem; ++lim_idx) |
2015
|
0 |
0 |
if (str_idx <= ent->subexp_from || ent->str_idx < str_idx) |
|
0 |
0 |
if (str_idx <= ent->subexp_from || ent->str_idx < str_idx) |
2019
|
0 |
0 |
if (ent->subexp_to == str_idx) |
2023
|
0 |
0 |
for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) |
2027
|
0 |
0 |
if (type == OP_OPEN_SUBEXP |
2028
|
0 |
0 |
&& subexp_idx == dfa->nodes[node].opr.idx) |
2030
|
0 |
0 |
else if (type == OP_CLOSE_SUBEXP |
2031
|
0 |
0 |
&& subexp_idx == dfa->nodes[node].opr.idx) |
2037
|
0 |
0 |
if (REG_VALID_INDEX (ops_node)) |
2041
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2046
|
0 |
0 |
if (REG_VALID_INDEX (cls_node)) |
2047
|
0 |
0 |
for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) |
2050
|
0 |
0 |
if (!re_node_set_contains (aTHX_ dfa->inveclosures + node, |
2052
|
0 |
0 |
&& !re_node_set_contains (aTHX_ dfa->eclosures + node, |
2059
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2067
|
0 |
0 |
for (node_idx = 0; node_idx < dest_nodes->nelem; ++node_idx) |
2071
|
0 |
0 |
if (type == OP_CLOSE_SUBEXP || type == OP_OPEN_SUBEXP) |
|
0 |
0 |
if (type == OP_CLOSE_SUBEXP || type == OP_OPEN_SUBEXP) |
2073
|
0 |
0 |
if (subexp_idx != dfa->nodes[node].opr.idx) |
2079
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2099
|
0 |
0 |
if (first_idx == REG_MISSING) |
2104
|
0 |
0 |
for (node_idx = 0; node_idx < candidates->nelem; ++node_idx) |
2112
|
0 |
0 |
if (node == sctx->last_node && str_idx == sctx->last_str_idx) |
|
0 |
0 |
if (node == sctx->last_node && str_idx == sctx->last_str_idx) |
2114
|
0 |
0 |
if (type != OP_BACK_REF) |
2127
|
0 |
0 |
if (entry->node != node) |
2132
|
0 |
0 |
: dfa->edests[node].elems[0]); |
2134
|
0 |
0 |
if (to_idx > sctx->last_str_idx |
2135
|
0 |
0 |
|| sctx->sifted_states[to_idx] == NULL |
2136
|
0 |
0 |
|| !STATE_NODE_CONTAINS (sctx->sifted_states[to_idx], dst_node) |
|
0 |
0 |
|| !STATE_NODE_CONTAINS (sctx->sifted_states[to_idx], dst_node) |
2137
|
0 |
0 |
|| check_dst_limits (aTHX_ mctx, &sctx->limits, node, |
2141
|
0 |
0 |
if (local_sctx.sifted_states == NULL) |
2145
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2151
|
0 |
0 |
if (BE (! ok, 0)) |
2158
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2160
|
0 |
0 |
if (sctx->limited_states != NULL) |
2165
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2174
|
0 |
0 |
while (enabled_idx++, entry++->more); |
2178
|
0 |
0 |
if (local_sctx.sifted_states != NULL) |
2180
|
0 |
0 |
re_node_set_free (&local_sctx.limits); |
2197
|
9 |
0 |
if (naccepted > 0 && str_idx + naccepted <= max_str_idx && |
|
9 |
0 |
if (naccepted > 0 && str_idx + naccepted <= max_str_idx && |
|
9 |
0 |
if (naccepted > 0 && str_idx + naccepted <= max_str_idx && |
2198
|
0 |
9 |
!STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted], |
2228
|
17 |
44 |
if (BE (state->accept_mb, 0)) |
2231
|
0 |
17 |
if (BE (*err != REG_NOERROR, 0)) |
2248
|
61 |
19 |
if (BE (trtable != NULL, 1)) |
2252
|
0 |
19 |
if (BE (trtable != NULL, 1)) |
2259
|
0 |
0 |
if (IS_WORD_CONTEXT (context)) |
2265
|
0 |
19 |
if (!build_trtable (aTHX_ mctx->dfa, state)) |
2284
|
30 |
32 |
if (cur_idx > mctx->state_log_top) |
2289
|
16 |
16 |
else if (mctx->state_log[cur_idx] == 0) |
2304
|
0 |
16 |
if (next_state != NULL) |
2309
|
0 |
0 |
if (BE (*err != REG_NOERROR, 0)) |
2325
|
0 |
16 |
if (table_nodes != NULL) |
2326
|
0 |
0 |
re_node_set_free (&next_nodes); |
2329
|
0 |
62 |
if (BE (dfa->nbackref, 0) && next_state != NULL) |
|
0 |
0 |
if (BE (dfa->nbackref, 0) && next_state != NULL) |
2336
|
0 |
0 |
if (BE (*err != REG_NOERROR, 0)) |
2340
|
0 |
0 |
if (next_state->has_backref) |
2343
|
0 |
0 |
if (BE (*err != REG_NOERROR, 0)) |
2367
|
17 |
32 |
if (++cur_str_idx > max) |
2371
|
16 |
16 |
while (mctx->state_log[cur_str_idx] == NULL); |
2375
|
16 |
0 |
while (*err == REG_NOERROR && cur_state == NULL); |
|
0 |
16 |
while (*err == REG_NOERROR && cur_state == NULL); |
2400
|
0 |
0 |
for (node_idx = 0; node_idx < cur_nodes->nelem; ++node_idx) |
2403
|
0 |
0 |
if (dfa->nodes[node].type == OP_OPEN_SUBEXP |
2404
|
0 |
0 |
&& dfa->nodes[node].opr.idx < BITSET_WORD_BITS |
2405
|
0 |
0 |
&& (dfa->used_bkref_map |
2409
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2467
|
68 |
17 |
for (i = 0; i < pstate->nodes.nelem; ++i) |
2476
|
51 |
17 |
if (!dfa->nodes[cur_node_idx].accept_mb) |
2479
|
0 |
17 |
if (dfa->nodes[cur_node_idx].constraint) |
2484
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (dfa->nodes[cur_node_idx].constraint, |
2492
|
1 |
16 |
if (naccepted == 0) |
2500
|
0 |
16 |
if (BE (err != REG_NOERROR, 0)) |
2508
|
16 |
0 |
if (dest_state == NULL) |
2514
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2521
|
0 |
16 |
if (dest_state != NULL) |
2522
|
0 |
0 |
re_node_set_free (&dest_nodes); |
2523
|
0 |
16 |
if (BE (mctx->state_log[dest_idx] == NULL && err != REG_NOERROR, 0)) |
|
0 |
0 |
if (BE (mctx->state_log[dest_idx] == NULL && err != REG_NOERROR, 0)) |
2539
|
0 |
0 |
for (i = 0; i < nodes->nelem; ++i) |
2548
|
0 |
0 |
if (node->type != OP_BACK_REF) |
2551
|
0 |
0 |
if (node->constraint) |
2555
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
2563
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2571
|
0 |
0 |
for (; bkc_idx < mctx->nbkref_ents; ++bkc_idx) |
2577
|
0 |
0 |
if (bkref_ent->node != node_idx || bkref_ent->str_idx != cur_str_idx) |
|
0 |
0 |
if (bkref_ent->node != node_idx || bkref_ent->str_idx != cur_str_idx) |
2582
|
0 |
0 |
: dfa->eclosures + dfa->nexts[node_idx]); |
2589
|
0 |
0 |
: mctx->state_log[cur_str_idx]->nodes.nelem); |
2591
|
0 |
0 |
if (dest_state == NULL) |
2596
|
0 |
0 |
if (BE (mctx->state_log[dest_str_idx] == NULL |
|
0 |
0 |
if (BE (mctx->state_log[dest_str_idx] == NULL |
2606
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2608
|
0 |
0 |
re_node_set_free (&dest_nodes); |
2613
|
0 |
0 |
re_node_set_free (&dest_nodes); |
2614
|
0 |
0 |
if (BE (mctx->state_log[dest_str_idx] == NULL |
|
0 |
0 |
if (BE (mctx->state_log[dest_str_idx] == NULL |
2620
|
0 |
0 |
if (subexp_len == 0 |
2621
|
0 |
0 |
&& mctx->state_log[cur_str_idx]->nodes.nelem > prev_nelem) |
2625
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2628
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2653
|
0 |
0 |
if (cache_idx != REG_MISSING) |
2658
|
0 |
0 |
if (entry->node == bkref_node) |
2660
|
0 |
0 |
while (entry++->more); |
2666
|
0 |
0 |
for (sub_top_idx = 0; sub_top_idx < mctx->nsub_tops; ++sub_top_idx) |
2673
|
0 |
0 |
if (dfa->nodes[sub_top->node].opr.idx != subexp_num) |
2680
|
0 |
0 |
for (sub_last_idx = 0; sub_last_idx < sub_top->nlasts; ++sub_last_idx) |
2687
|
0 |
0 |
if (sl_str_diff > 0) |
2689
|
0 |
0 |
if (BE (bkref_str_off + sl_str_diff > mctx->input.valid_len, 0)) |
2692
|
0 |
0 |
if (bkref_str_off + sl_str_diff > mctx->input.len) |
2698
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2702
|
0 |
0 |
if (memcmp (buf + bkref_str_off, buf + sl_str, sl_str_diff) != 0) |
2715
|
0 |
0 |
if (err == REG_NOMATCH) |
2717
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2721
|
0 |
0 |
if (sub_last_idx < sub_top->nlasts) |
2723
|
0 |
0 |
if (sub_last_idx > 0) |
2726
|
0 |
0 |
for (; sl_str <= bkref_str_idx; ++sl_str) |
2734
|
0 |
0 |
if (sl_str_off > 0) |
2736
|
0 |
0 |
if (BE (bkref_str_off >= mctx->input.valid_len, 0)) |
2739
|
0 |
0 |
if (bkref_str_off >= mctx->input.len) |
2743
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2748
|
0 |
0 |
if (buf [bkref_str_off++] != buf[sl_str - 1]) |
2752
|
0 |
0 |
if (mctx->state_log[sl_str] == NULL) |
2758
|
0 |
0 |
if (cls_node == REG_MISSING) |
2760
|
0 |
0 |
if (sub_top->path == NULL) |
2762
|
0 |
0 |
re_calloc(sub_top->path, state_array_t, sl_str - sub_top->str_idx + 1); |
2769
|
0 |
0 |
if (err == REG_NOMATCH) |
2771
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2774
|
0 |
0 |
if (BE (sub_last == NULL, 0)) |
2778
|
0 |
0 |
if (err == REG_NOMATCH) |
2802
|
0 |
0 |
if (err != REG_NOERROR) |
2806
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2826
|
0 |
0 |
for (cls_idx = 0; cls_idx < nodes->nelem; ++cls_idx) |
2830
|
0 |
0 |
if (node->type == type |
2831
|
0 |
0 |
&& node->opr.idx == subexp_idx) |
2857
|
0 |
0 |
if (BE (path->alloc < last_str + mctx->max_mb_elem_len + 1, 0)) |
2862
|
0 |
0 |
if (BE (IDX_MAX - old_alloc < incr_alloc, 0)) |
2865
|
0 |
0 |
if (BE (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc, 0)) |
2867
|
0 |
0 |
re_realloc (path->array, re_dfastate_t *, new_alloc); |
2873
|
0 |
0 |
str_idx = path->next_idx ? path->next_idx : top_str; |
2883
|
0 |
0 |
if (str_idx == top_str) |
2886
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2889
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2891
|
0 |
0 |
re_node_set_free (&next_nodes); |
2898
|
0 |
0 |
if (cur_state && cur_state->has_backref) |
|
0 |
0 |
if (cur_state && cur_state->has_backref) |
2901
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2907
|
0 |
0 |
if (str_idx == top_str || (cur_state && cur_state->has_backref)) |
|
0 |
0 |
if (str_idx == top_str || (cur_state && cur_state->has_backref)) |
|
0 |
0 |
if (str_idx == top_str || (cur_state && cur_state->has_backref)) |
2909
|
0 |
0 |
if (next_nodes.nelem) |
2913
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2915
|
0 |
0 |
re_node_set_free (&next_nodes); |
2920
|
0 |
0 |
if (BE (cur_state == NULL && err != REG_NOERROR, 0)) |
|
0 |
0 |
if (BE (cur_state == NULL && err != REG_NOERROR, 0)) |
2922
|
0 |
0 |
re_node_set_free (&next_nodes); |
2928
|
0 |
0 |
for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;) |
|
0 |
0 |
for (null_cnt = 0; str_idx < last_str && null_cnt <= mctx->max_mb_elem_len;) |
2931
|
0 |
0 |
if (mctx->state_log[str_idx + 1]) |
2935
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2937
|
0 |
0 |
re_node_set_free (&next_nodes); |
2941
|
0 |
0 |
if (cur_state) |
2946
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2948
|
0 |
0 |
re_node_set_free (&next_nodes); |
2953
|
0 |
0 |
if (next_nodes.nelem) |
2956
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2958
|
0 |
0 |
re_node_set_free (&next_nodes); |
2963
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
2965
|
0 |
0 |
re_node_set_free (&next_nodes); |
2971
|
0 |
0 |
if (BE (cur_state == NULL && err != REG_NOERROR, 0)) |
|
0 |
0 |
if (BE (cur_state == NULL && err != REG_NOERROR, 0)) |
2973
|
0 |
0 |
re_node_set_free (&next_nodes); |
2977
|
0 |
0 |
null_cnt = cur_state == NULL ? null_cnt + 1 : 0; |
2979
|
0 |
0 |
re_node_set_free (&next_nodes); |
2981
|
0 |
0 |
: &mctx->state_log[last_str]->nodes); |
2989
|
0 |
0 |
if (cur_nodes != NULL && re_node_set_contains (aTHX_ cur_nodes, last_node)) |
|
0 |
0 |
if (cur_nodes != NULL && re_node_set_contains (aTHX_ cur_nodes, last_node)) |
3016
|
0 |
0 |
for (cur_idx = 0; cur_idx < cur_nodes->nelem; ++cur_idx) |
3026
|
0 |
0 |
if (dfa->nodes[cur_node].accept_mb) |
3030
|
0 |
0 |
if (naccepted > 1) |
3037
|
0 |
0 |
if (dest_state) |
3040
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
3042
|
0 |
0 |
re_node_set_free (&union_set); |
3047
|
0 |
0 |
if (BE (! ok, 0)) |
3049
|
0 |
0 |
re_node_set_free (&union_set); |
3054
|
0 |
0 |
if (BE (mctx->state_log[next_idx] == NULL |
|
0 |
0 |
if (BE (mctx->state_log[next_idx] == NULL |
3057
|
0 |
0 |
re_node_set_free (&union_set); |
3063
|
0 |
0 |
if (naccepted |
3064
|
0 |
0 |
|| check_node_accept (aTHX_ mctx, dfa->nodes + cur_node, str_idx)) |
3067
|
0 |
0 |
if (BE (! ok, 0)) |
3069
|
0 |
0 |
re_node_set_free (&union_set); |
3074
|
0 |
0 |
re_node_set_free (&union_set); |
3096
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
3101
|
0 |
0 |
for (idx = 0; idx < cur_nodes->nelem; ++idx) |
3106
|
0 |
0 |
if (outside_node == REG_MISSING) |
3110
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
3112
|
0 |
0 |
re_node_set_free (&new_nodes); |
3121
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
3123
|
0 |
0 |
re_node_set_free (&new_nodes); |
3128
|
0 |
0 |
re_node_set_free (cur_nodes); |
3143
|
0 |
0 |
for (cur_node = target; !re_node_set_contains (aTHX_ dst_nodes, cur_node);) |
3147
|
0 |
0 |
if (dfa->nodes[cur_node].type == type |
3148
|
0 |
0 |
&& dfa->nodes[cur_node].opr.idx == ex_subexp) |
3150
|
0 |
0 |
if (type == OP_CLOSE_SUBEXP) |
3153
|
0 |
0 |
if (BE (! ok, 0)) |
3159
|
0 |
0 |
if (BE (! ok, 0)) |
3161
|
0 |
0 |
if (dfa->edests[cur_node].nelem == 0) |
3163
|
0 |
0 |
if (dfa->edests[cur_node].nelem == 2) |
3169
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
3192
|
0 |
0 |
if (cache_idx_start == REG_MISSING) |
3202
|
0 |
0 |
if (!re_node_set_contains (aTHX_ cur_nodes, ent->node)) |
3208
|
0 |
0 |
if (to_idx == cur_str) |
3215
|
0 |
0 |
if (re_node_set_contains (aTHX_ cur_nodes, next_node)) |
3220
|
0 |
0 |
re_node_set_free (&new_dests); |
3221
|
0 |
0 |
if (BE (err != REG_NOERROR || err2 != REG_NOERROR |
|
0 |
0 |
if (BE (err != REG_NOERROR || err2 != REG_NOERROR |
|
0 |
0 |
if (BE (err != REG_NOERROR || err2 != REG_NOERROR |
|
0 |
0 |
if (BE (err != REG_NOERROR || err2 != REG_NOERROR |
3224
|
0 |
0 |
err = (err != REG_NOERROR ? err |
|
0 |
0 |
err = (err != REG_NOERROR ? err |
3235
|
0 |
0 |
if (mctx->state_log[to_idx]) |
3238
|
0 |
0 |
if (re_node_set_contains (aTHX_ &mctx->state_log[to_idx]->nodes, |
3244
|
0 |
0 |
if (BE (err != REG_NOERROR || ! ok, 0)) |
|
0 |
0 |
if (BE (err != REG_NOERROR || ! ok, 0)) |
3246
|
0 |
0 |
re_node_set_free (&union_set); |
3247
|
0 |
0 |
err = err != REG_NOERROR ? err : REG_ESPACE; |
3254
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
3258
|
0 |
0 |
re_node_set_free (&union_set); |
3259
|
0 |
0 |
if (BE (mctx->state_log[to_idx] == NULL |
|
0 |
0 |
if (BE (mctx->state_log[to_idx] == NULL |
3264
|
0 |
0 |
while (ent++->more); |
3315
|
2 |
17 |
if (BE (! REG_VALID_NONZERO_INDEX (ndests), 0)) |
3317
|
2 |
0 |
if (dests_node_malloced) |
3318
|
2 |
0 |
re_free (dests_alloc); |
3320
|
2 |
0 |
if (ndests == 0) |
3329
|
0 |
17 |
if (BE (err != REG_NOERROR, 0)) |
3333
|
0 |
17 |
if (BE ((((SIZE_MAX - (sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX) |
3349
|
0 |
17 |
Newx(dest_states, ndests * 3 * sizeof (re_dfastate_t *), re_dfastate_t *); |
3350
|
0 |
17 |
if (BE (dest_states == NULL, 0)) |
3353
|
0 |
0 |
if (dest_states_malloced) |
3354
|
0 |
0 |
re_free (dest_states); |
3355
|
0 |
0 |
re_node_set_free (&follows); |
3356
|
0 |
0 |
for (i = 0; i < ndests; ++i) |
3357
|
0 |
0 |
re_node_set_free (dests_node + i); |
3358
|
0 |
0 |
if (dests_node_malloced) |
3359
|
0 |
0 |
re_free (dests_alloc); |
3369
|
17 |
17 |
for (i = 0; i < ndests; ++i) |
3374
|
17 |
17 |
for (j = 0; j < dests_node[i].nelem; ++j) |
3377
|
17 |
0 |
if (next_node != REG_MISSING) |
3380
|
0 |
17 |
if (BE (err != REG_NOERROR, 0)) |
3385
|
0 |
17 |
if (BE (dest_states[i] == NULL && err != REG_NOERROR, 0)) |
|
0 |
0 |
if (BE (dest_states[i] == NULL && err != REG_NOERROR, 0)) |
3389
|
0 |
17 |
if (dest_states[i]->has_constraint) |
3393
|
0 |
0 |
if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0)) |
|
0 |
0 |
if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0)) |
3396
|
0 |
0 |
if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1) |
|
0 |
0 |
if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1) |
3401
|
0 |
0 |
if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0)) |
|
0 |
0 |
if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0)) |
3412
|
17 |
0 |
if (!BE (need_word_trtable, 0)) |
3422
|
68 |
17 |
for (i = 0; i < BITSET_WORDS; ++i) |
3423
|
926 |
68 |
for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1; |
3426
|
269 |
657 |
if (BE (elem & 1, 0)) |
3430
|
0 |
269 |
for (j = 0; (dests_ch[j][i] & mask) == 0; ++j) |
3434
|
0 |
269 |
if (dfa->word_char[i] & mask) |
3451
|
0 |
0 |
for (i = 0; i < BITSET_WORDS; ++i) |
3452
|
0 |
0 |
for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1; |
3455
|
0 |
0 |
if (BE (elem & 1, 0)) |
3459
|
0 |
0 |
for (j = 0; (dests_ch[j][i] & mask) == 0; ++j) |
3469
|
2 |
15 |
if (bitset_contain (aTHX_ acceptable, NEWLINE_CHAR)) |
3472
|
2 |
0 |
for (j = 0; j < ndests; ++j) |
3473
|
2 |
0 |
if (bitset_contain (aTHX_ dests_ch[j], NEWLINE_CHAR)) |
3477
|
0 |
2 |
if (need_word_trtable) |
3485
|
17 |
0 |
if (dest_states_malloced) |
3486
|
17 |
0 |
re_free (dest_states); |
3488
|
17 |
0 |
re_node_set_free (&follows); |
3489
|
17 |
17 |
for (i = 0; i < ndests; ++i) |
3490
|
17 |
0 |
re_node_set_free (dests_node + i); |
3492
|
17 |
0 |
if (dests_node_malloced) |
3493
|
17 |
0 |
re_free (dests_alloc); |
3518
|
35 |
19 |
for (i = 0; i < cur_nodes->nelem; ++i) |
3525
|
15 |
20 |
if (type == CHARACTER) |
3527
|
2 |
18 |
else if (type == SIMPLE_BRACKET) |
3531
|
0 |
18 |
else if (type == OP_PERIOD) |
3534
|
0 |
0 |
if (dfa->mb_cur_max > 1) |
3539
|
0 |
0 |
if (!(dfa->syntax & RE_DOT_NEWLINE)) |
3541
|
0 |
0 |
if (dfa->syntax & RE_DOT_NOT_NULL) |
3545
|
0 |
18 |
else if (type == OP_UTF8_PERIOD) |
3551
|
0 |
0 |
if (!(dfa->syntax & RE_DOT_NEWLINE)) |
3553
|
0 |
0 |
if (dfa->syntax & RE_DOT_NOT_NULL) |
3562
|
0 |
17 |
if (constraint) |
3564
|
0 |
0 |
if (constraint & NEXT_NEWLINE_CONSTRAINT) |
3568
|
0 |
0 |
if (accepts_newline) |
3573
|
0 |
0 |
if (constraint & NEXT_ENDBUF_CONSTRAINT) |
3579
|
0 |
0 |
if (constraint & NEXT_WORD_CONSTRAINT) |
3582
|
0 |
0 |
if (type == CHARACTER && !node->word_char) |
|
0 |
0 |
if (type == CHARACTER && !node->word_char) |
3588
|
0 |
0 |
if (dfa->mb_cur_max > 1) |
3589
|
0 |
0 |
for (j = 0; j < BITSET_WORDS; ++j) |
3593
|
0 |
0 |
for (j = 0; j < BITSET_WORDS; ++j) |
3595
|
0 |
0 |
if (!any_set) |
3598
|
0 |
0 |
if (constraint & NEXT_NOTWORD_CONSTRAINT) |
3601
|
0 |
0 |
if (type == CHARACTER && node->word_char) |
|
0 |
0 |
if (type == CHARACTER && node->word_char) |
3607
|
0 |
0 |
if (dfa->mb_cur_max > 1) |
3608
|
0 |
0 |
for (j = 0; j < BITSET_WORDS; ++j) |
3612
|
0 |
0 |
for (j = 0; j < BITSET_WORDS; ++j) |
3614
|
0 |
0 |
if (!any_set) |
3621
|
0 |
17 |
for (j = 0; j < ndests; ++j) |
3629
|
0 |
0 |
if (type == CHARACTER && !bitset_contain (aTHX_ dests_ch[j], node->opr.c)) |
|
0 |
0 |
if (type == CHARACTER && !bitset_contain (aTHX_ dests_ch[j], node->opr.c)) |
3634
|
0 |
0 |
for (k = 0; k < BITSET_WORDS; ++k) |
3637
|
0 |
0 |
if (!has_intersec) |
3642
|
0 |
0 |
for (k = 0; k < BITSET_WORDS; ++k) |
3650
|
0 |
0 |
if (not_subset) |
3655
|
0 |
0 |
if (BE (err != REG_NOERROR, 0)) |
3662
|
0 |
0 |
if (BE (! ok, 0)) |
3666
|
0 |
0 |
if (!not_consumed) |
3670
|
17 |
0 |
if (j == ndests) |
3674
|
0 |
17 |
if (BE (err != REG_NOERROR, 0)) |
3682
|
0 |
0 |
for (j = 0; j < ndests; ++j) |
3683
|
0 |
0 |
re_node_set_free (dests_node + j); |
3705
|
0 |
35 |
if (BE (node->type == OP_UTF8_PERIOD, 0)) |
3708
|
0 |
0 |
if (BE (c < 0xc2, 1)) |
3711
|
0 |
0 |
if (str_idx + 2 > input->len) |
3715
|
0 |
0 |
if (c < 0xe0) |
3716
|
0 |
0 |
return (d < 0x80 || d > 0xbf) ? 0 : 2; |
|
0 |
0 |
return (d < 0x80 || d > 0xbf) ? 0 : 2; |
3717
|
0 |
0 |
else if (c < 0xf0) |
3720
|
0 |
0 |
if (c == 0xe0 && d < 0xa0) |
|
0 |
0 |
if (c == 0xe0 && d < 0xa0) |
3723
|
0 |
0 |
else if (c < 0xf8) |
3726
|
0 |
0 |
if (c == 0xf0 && d < 0x90) |
|
0 |
0 |
if (c == 0xf0 && d < 0x90) |
3729
|
0 |
0 |
else if (c < 0xfc) |
3732
|
0 |
0 |
if (c == 0xf8 && d < 0x88) |
|
0 |
0 |
if (c == 0xf8 && d < 0x88) |
3735
|
0 |
0 |
else if (c < 0xfe) |
3738
|
0 |
0 |
if (c == 0xfc && d < 0x84) |
|
0 |
0 |
if (c == 0xfc && d < 0x84) |
3744
|
0 |
0 |
if (str_idx + char_len > input->len) |
3747
|
0 |
0 |
for (i = 1; i < char_len; ++i) |
3750
|
0 |
0 |
if (d < 0x80 || d > 0xbf) |
|
0 |
0 |
if (d < 0x80 || d > 0xbf) |
3757
|
0 |
35 |
if (node->type == OP_PERIOD) |
3759
|
0 |
0 |
if (char_len <= 1) |
3764
|
0 |
0 |
if ((!(dfa->syntax & RE_DOT_NEWLINE) && |
|
0 |
0 |
if ((!(dfa->syntax & RE_DOT_NEWLINE) && |
3765
|
0 |
0 |
re_string_byte_at (input, str_idx) == '\n') || |
3766
|
0 |
0 |
((dfa->syntax & RE_DOT_NOT_NULL) && |
3773
|
1 |
34 |
if ((elem_len <= 1 && char_len <= 1) || char_len == 0) |
|
0 |
1 |
if ((elem_len <= 1 && char_len <= 1) || char_len == 0) |
|
0 |
34 |
if ((elem_len <= 1 && char_len <= 1) || char_len == 0) |
3776
|
34 |
0 |
if (node->type == COMPLEX_BRACKET) |
3786
|
34 |
0 |
wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars) |
|
34 |
0 |
wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars) |
|
0 |
34 |
wchar_t wc = ((cset->nranges || cset->nchar_classes || cset->nmbchars) |
3790
|
0 |
34 |
for (i = 0; i < cset->nmbchars; ++i) |
3791
|
0 |
0 |
if (wc == cset->mbchars[i]) |
3797
|
0 |
34 |
for (i = 0; i < cset->nchar_classes; ++i) |
3800
|
0 |
0 |
if (rpl__iswctype (wc, wt)) |
3904
|
0 |
34 |
for (i = 0; i < cset->nranges; ++i) |
3906
|
0 |
0 |
if (cset->range_starts[i] <= wc && wc <= cset->range_ends[i]) |
|
0 |
0 |
if (cset->range_starts[i] <= wc && wc <= cset->range_ends[i]) |
3914
|
0 |
34 |
if (!cset->non_match) |
3918
|
0 |
34 |
if (match_len > 0) |
4002
|
0 |
14 |
if (node->opr.c != ch) |
4007
|
9 |
0 |
if (!bitset_contain (aTHX_ node->opr.sbcset, ch)) |
4013
|
0 |
0 |
if (ch >= ASCII_CHARS) |
4018
|
0 |
0 |
if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE)) |
|
0 |
0 |
if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE)) |
4019
|
0 |
0 |
|| (ch == '\0' && (mctx->dfa->syntax & RE_DOT_NOT_NULL))) |
|
0 |
0 |
|| (ch == '\0' && (mctx->dfa->syntax & RE_DOT_NOT_NULL))) |
4027
|
0 |
14 |
if (node->constraint) |
4033
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
|
0 |
0 |
if (NOT_SATISFY_NEXT_CONSTRAINT (node->constraint, context)) |
4050
|
0 |
0 |
if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2 |
4058
|
0 |
0 |
if (BE (ret != REG_NOERROR, 0)) |
4061
|
0 |
0 |
if (mctx->state_log != NULL) |
4067
|
0 |
0 |
re_realloc (mctx->state_log, re_dfastate_t *, pstr->bufs_len + 1); |
4071
|
0 |
0 |
if (pstr->icase) |
4074
|
0 |
0 |
if (pstr->mb_cur_max > 1) |
4077
|
0 |
0 |
if (BE (ret != REG_NOERROR, 0)) |
4087
|
0 |
0 |
if (pstr->mb_cur_max > 1) |
4092
|
0 |
0 |
if (pstr->trans != NULL) |
4110
|
0 |
14 |
if (n > 0) |
4116
|
0 |
0 |
if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n, 0)) |
4119
|
0 |
0 |
re_malloc (mctx->bkref_ents, struct re_backref_cache_entry, n); |
4120
|
0 |
0 |
re_malloc (mctx->sub_tops, re_sub_match_top_t *, n); |
4142
|
0 |
23 |
for (st_idx = 0; st_idx < mctx->nsub_tops; ++st_idx) |
4146
|
0 |
0 |
for (sl_idx = 0; sl_idx < top->nlasts; ++sl_idx) |
4149
|
0 |
0 |
re_free (last->path.array); |
4150
|
0 |
0 |
re_free (last); |
4152
|
0 |
0 |
re_free (top->lasts); |
4153
|
0 |
0 |
if (top->path) |
4155
|
0 |
0 |
re_free (top->path->array); |
4156
|
0 |
0 |
re_free (top->path); |
4158
|
0 |
0 |
re_free (top); |
4173
|
0 |
0 |
re_free (mctx->sub_tops); |
4174
|
0 |
0 |
re_free (mctx->bkref_ents); |
4187
|
0 |
0 |
if (mctx->nbkref_ents >= mctx->abkref_ents) |
4189
|
0 |
0 |
re_realloc (mctx->bkref_ents, struct re_backref_cache_entry, mctx->abkref_ents * 2); |
4194
|
0 |
0 |
if (mctx->nbkref_ents > 0 |
4195
|
0 |
0 |
&& mctx->bkref_ents[mctx->nbkref_ents - 1].str_idx == str_idx) |
4212
|
0 |
0 |
= (from == to ? -1 : 0); |
4215
|
0 |
0 |
if (mctx->max_mb_elem_len < to - from) |
4229
|
0 |
0 |
for (left = 0; left < right;) |
4232
|
0 |
0 |
if (mctx->bkref_ents[mid].str_idx < str_idx) |
4237
|
0 |
0 |
if (left < last && mctx->bkref_ents[left].str_idx == str_idx) |
|
0 |
0 |
if (left < last && mctx->bkref_ents[left].str_idx == str_idx) |
4254
|
0 |
0 |
if (BE (mctx->nsub_tops == mctx->asub_tops, 0)) |
4257
|
0 |
0 |
re_realloc (mctx->sub_tops, re_sub_match_top_t *, new_asub_tops); |
4274
|
0 |
0 |
if (BE (subtop->nlasts == subtop->alasts, 0)) |
4277
|
0 |
0 |
re_realloc (subtop->lasts, re_sub_match_last_t *, new_alasts); |