Lines Matching refs:cb

46 #define NLBLOCK cb             /* Block containing newline information */
920 static void show_parsed(compile_block *cb) in show_parsed() argument
922 uint32_t *pptr = cb->parsed_pattern; in show_parsed()
932 fprintf(stderr, "+++ %02d %.8x ", (int)(pptr - cb->parsed_pattern), *pptr); in show_parsed()
961 offset = cb->small_ref_offset[meta_arg]; in show_parsed()
1502 compile_block *cb) in PRIV()
1544 if (cb != NULL && (escape == ESC_P || escape == ESC_p || escape == ESC_X)) in PRIV()
1545 cb->external_flags |= PCRE2_HASBKPORX; /* Note \P, \p, or \X */ in PRIV()
1606 if (cb == NULL) in PRIV()
1740 if (!read_number(&p, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &s, in PRIV()
1758 if (!read_number(&ptr, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &s, in PRIV()
1806 (s < 10 || oldptr[-1] >= CHAR_8 || s <= (int)cb->bracount)) in PRIV()
2086 uint16_t *pdataptr, int *errorcodeptr, compile_block *cb) in get_ucp() argument
2093 if (ptr >= cb->end_pattern) goto ERROR_RETURN; in get_ucp()
2102 if (ptr >= cb->end_pattern) goto ERROR_RETURN; in get_ucp()
2110 if (ptr >= cb->end_pattern) goto ERROR_RETURN; in get_ucp()
2123 else if (MAX_255(c) && (cb->ctypes[c] & ctype_letter) != 0) in get_ucp()
2296 int *errorcodeptr, compile_block *cb) in read_name() argument
2309 *offsetptr = (PCRE2_SIZE)(ptr - cb->start_pattern); in read_name()
2355 while (ptr < ptrend && MAX_255(*ptr) && (cb->ctypes[*ptr] & ctype_word) != 0) in read_name()
2420 uint32_t *parsed_pattern, compile_block *cb) in manage_callouts() argument
2425 cb->start_pattern - (PCRE2_SIZE)previous_callout[1]); in manage_callouts()
2439 previous_callout[1] = (uint32_t)(ptr - cb->start_pattern); in manage_callouts()
2514 compile_block *cb) in parse_regex() argument
2523 uint32_t *parsed_pattern = cb->parsed_pattern; in parse_regex()
2524 uint32_t *parsed_pattern_end = cb->parsed_pattern_end; in parse_regex()
2527 uint32_t extra_options = cb->cx->extra_options; in parse_regex()
2543 PCRE2_SPTR ptrend = cb->end_pattern; in parse_regex()
2578 auto_callout, parsed_pattern, cb); in parse_regex()
2587 end_nests = (nest_save *)(cb->start_workspace + cb->workspace_size); in parse_regex()
2594 ((cb->workspace_size * sizeof(PCRE2_UCHAR)) % sizeof(nest_save))); in parse_regex()
2619 if (nest_depth > cb->cx->parens_nest_limit) in parse_regex()
2659 auto_callout, parsed_pattern, cb); in parse_regex()
2687 (c < 256 && c != CHAR_NUMBER_SIGN && (cb->ctypes[c] & ctype_space) == 0 in parse_regex()
2733 cb->cx->extra_options, FALSE, cb); in parse_regex()
2787 if (c < 256 && (cb->ctypes[c] & ctype_space) != 0) continue; in parse_regex()
2797 ptr += cb->nllen; in parse_regex()
2834 parsed_pattern, cb); in parse_regex()
2854 ok = MAX_255(ptr[1]) && (cb->ctypes[ptr[1]] & ctype_lcletter) != 0; in parse_regex()
2926 cb->cx->extra_options, FALSE, cb); in parse_regex()
2956 offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 1); in parse_regex()
2961 if (cb->small_ref_offset[escape] == PCRE2_UNSET) in parse_regex()
2962 cb->small_ref_offset[escape] = offset; in parse_regex()
3071 if (!get_ucp(&ptr, &negated, &ptype, &pdata, &errorcode, cb)) in parse_regex()
3108 if (read_number(&p, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &i, in parse_regex()
3125 &errorcode, cb)) goto ESCAPE_FAILED; in parse_regex()
3312 (cb->external_options & PCRE2_ALLOW_EMPTY_CLASS) != 0) in parse_regex()
3503 cb->cx->extra_options, TRUE, cb); in parse_regex()
3618 if (!get_ucp(&ptr, &negated, &ptype, &pdata, &errorcode, cb)) in parse_regex()
3691 if (cb->bracount >= MAX_GROUP_NUMBER) in parse_regex()
3696 cb->bracount++; in parse_regex()
3697 *parsed_pattern++ = META_CAPTURE | cb->bracount; in parse_regex()
3714 else if (CHMAX_255(c) && (cb->ctypes[c] & ctype_lcletter) != 0) in parse_regex()
3720 &errorcode, cb)) goto FAILED; in parse_regex()
3797 if (top_nest == NULL) top_nest = (nest_save *)(cb->start_workspace); in parse_regex()
3822 &errorcode, cb)) goto FAILED; in parse_regex()
3929 if (top_nest == NULL) top_nest = (nest_save *)(cb->start_workspace); in parse_regex()
3944 top_nest->reset_group = (uint16_t)cb->bracount; in parse_regex()
3945 top_nest->max_group = (uint16_t)cb->bracount; in parse_regex()
3947 cb->external_flags |= PCRE2_DUPCAPUSED; in parse_regex()
3992 cb->external_flags |= PCRE2_JCHANGED; in parse_regex()
4040 if (top_nest > (nest_save *)(cb->start_workspace) && in parse_regex()
4084 &namelen, &errorcode, cb)) goto FAILED; in parse_regex()
4119 (IS_DIGIT(*ptr))? -1:(int)(cb->bracount), /* + and - are relative */ in parse_regex()
4132 offset = (PCRE2_SIZE)(ptr - cb->start_pattern); in parse_regex()
4144 &namelen, &errorcode, cb)) goto FAILED; in parse_regex()
4227 offset = (PCRE2_SIZE)(startptr - cb->start_pattern); in parse_regex()
4263 previous_callout[1] = (uint32_t)(ptr - cb->start_pattern); in parse_regex()
4309 if (read_number(&ptr, ptrend, cb->bracount, MAX_GROUP_NUMBER, ERR61, &i, in parse_regex()
4318 offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 2); in parse_regex()
4393 &errorcode, cb)) goto FAILED; in parse_regex()
4494 offset = (PCRE2_SIZE)(ptr - cb->start_pattern - 2); in parse_regex()
4512 if (top_nest == NULL) top_nest = (nest_save *)(cb->start_workspace); in parse_regex()
4536 &errorcode, cb)) goto FAILED; in parse_regex()
4541 if (cb->bracount >= MAX_GROUP_NUMBER) in parse_regex()
4546 cb->bracount++; in parse_regex()
4547 *parsed_pattern++ = META_CAPTURE | cb->bracount; in parse_regex()
4552 if (cb->names_found >= MAX_NAME_COUNT) in parse_regex()
4560 if (namelen + IMM2_SIZE + 1 > cb->name_entry_size) in parse_regex()
4561 cb->name_entry_size = (uint16_t)(namelen + IMM2_SIZE + 1); in parse_regex()
4571 ng = cb->named_groups; in parse_regex()
4572 for (i = 0; i < cb->names_found; i++, ng++) in parse_regex()
4577 if (ng->number == cb->bracount) break; in parse_regex()
4584 cb->dupnames = TRUE; /* Duplicate names exist */ in parse_regex()
4586 else if (ng->number == cb->bracount) in parse_regex()
4593 if (i < cb->names_found) break; /* Ignore duplicate with same number */ in parse_regex()
4597 if (cb->names_found >= cb->named_group_list_size) in parse_regex()
4599 uint32_t newsize = cb->named_group_list_size * 2; in parse_regex()
4601 cb->cx->memctl.malloc(newsize * sizeof(named_group), in parse_regex()
4602 cb->cx->memctl.memory_data); in parse_regex()
4609 memcpy(newspace, cb->named_groups, in parse_regex()
4610 cb->named_group_list_size * sizeof(named_group)); in parse_regex()
4611 if (cb->named_group_list_size > NAMED_GROUP_LIST_SIZE) in parse_regex()
4612 cb->cx->memctl.free((void *)cb->named_groups, in parse_regex()
4613 cb->cx->memctl.memory_data); in parse_regex()
4614 cb->named_groups = newspace; in parse_regex()
4615 cb->named_group_list_size = newsize; in parse_regex()
4620 cb->named_groups[cb->names_found].name = name; in parse_regex()
4621 cb->named_groups[cb->names_found].length = (uint16_t)namelen; in parse_regex()
4622 cb->named_groups[cb->names_found].number = cb->bracount; in parse_regex()
4623 cb->named_groups[cb->names_found].isdup = (uint16_t)isdupname; in parse_regex()
4624 cb->names_found++; in parse_regex()
4638 if (cb->bracount > top_nest->max_group) in parse_regex()
4639 top_nest->max_group = (uint16_t)cb->bracount; in parse_regex()
4640 cb->bracount = top_nest->reset_group; in parse_regex()
4655 top_nest->max_group > cb->bracount) in parse_regex()
4656 cb->bracount = top_nest->max_group; in parse_regex()
4665 if (top_nest == (nest_save *)(cb->start_workspace)) top_nest = NULL; in parse_regex()
4691 parsed_pattern, cb); in parse_regex()
4725 cb->erroroffset = (PCRE2_SIZE)(ptr - cb->start_pattern); in parse_regex()
4915 uint32_t options, compile_block *cb, uint32_t start, uint32_t end) in add_to_class_internal() argument
4941 if (rc > 0) n8 += add_list_to_class_internal(classbits, uchardptr, options, cb, in add_to_class_internal()
4946 else if (oc >= cb->class_range_start && od <= cb->class_range_end) continue; in add_to_class_internal()
4958 else n8 += add_to_class_internal(classbits, uchardptr, options, cb, oc, od); in add_to_class_internal()
4968 SETBIT(classbits, cb->fcc[c]); in add_to_class_internal()
4980 if (start > cb->class_range_start && end < cb->class_range_end) return n8; in add_to_class_internal()
5070 uint32_t options, compile_block *cb, const uint32_t *p, unsigned int except) in add_list_to_class_internal() argument
5079 n8 += add_to_class_internal(classbits, uchardptr, options, cb, p[0], p[n]); in add_list_to_class_internal()
5110 compile_block *cb, uint32_t start, uint32_t end) in add_to_class() argument
5112 cb->class_range_start = start; in add_to_class()
5113 cb->class_range_end = end; in add_to_class()
5114 return add_to_class_internal(classbits, uchardptr, options, cb, start, end); in add_to_class()
5144 compile_block *cb, const uint32_t *p, unsigned int except) in add_list_to_class() argument
5153 cb->class_range_start = p[0]; in add_list_to_class()
5154 cb->class_range_end = p[n]; in add_list_to_class()
5155 n8 += add_to_class_internal(classbits, uchardptr, options, cb, p[0], p[n]); in add_list_to_class()
5184 uint32_t options, compile_block *cb, const uint32_t *p) in add_not_list_to_class() argument
5189 n8 += add_to_class(classbits, uchardptr, options, cb, 0, p[0] - 1); in add_not_list_to_class()
5193 n8 += add_to_class(classbits, uchardptr, options, cb, p[0] + 1, in add_not_list_to_class()
5223 int *countptr, int *errorcodeptr, compile_block *cb) in find_dupname_details() argument
5227 PCRE2_UCHAR *slot = cb->name_table; in find_dupname_details()
5231 for (i = 0; i < cb->names_found; i++) in find_dupname_details()
5235 slot += cb->name_entry_size; in find_dupname_details()
5241 if (i >= cb->names_found) in find_dupname_details()
5244 cb->erroroffset = name - cb->start_pattern; in find_dupname_details()
5258 cb->backref_map |= (groupnumber < 32)? (1u << groupnumber) : 1; in find_dupname_details()
5259 if (groupnumber > cb->top_backref) cb->top_backref = groupnumber; in find_dupname_details()
5260 if (++i >= cb->names_found) break; in find_dupname_details()
5261 slot += cb->name_entry_size; in find_dupname_details()
5305 compile_block *cb, PCRE2_SIZE *lengthptr) in compile_branch() argument
5335 const uint8_t *cbits = cb->cbits; in compile_branch()
5418 if (code > cb->start_workspace + cb->workspace_size - in compile_branch()
5421 *errorcodeptr = (code >= cb->start_workspace + cb->workspace_size)? in compile_branch()
5634 d = TABLE_GET(c, cb->fcc, c); in compile_branch()
5871 options & ~PCRE2_CASELESS, cb, PRIV(hspace_list), NOTACHAR); in compile_branch()
5876 options & ~PCRE2_CASELESS, cb, PRIV(hspace_list)); in compile_branch()
5881 options & ~PCRE2_CASELESS, cb, PRIV(vspace_list), NOTACHAR); in compile_branch()
5886 options & ~PCRE2_CASELESS, cb, PRIV(vspace_list)); in compile_branch()
5925 if (c == CHAR_CR || c == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF; in compile_branch()
5940 if (d == CHAR_CR || d == CHAR_NL) cb->external_flags |= PCRE2_HASCRORLF; in compile_branch()
5949 (cb->ctypes[c] & ctype_letter) != 0 && in compile_branch()
5950 (cb->ctypes[d] & ctype_letter) != 0 && in compile_branch()
5960 add_to_class(classbits, &class_uchardata, options, cb, C + uc, in compile_branch()
5968 add_to_class(classbits, &class_uchardata, options, cb, C + uc, in compile_branch()
5976 add_to_class(classbits, &class_uchardata, options, cb, C + uc, in compile_branch()
5985 add_to_class(classbits, &class_uchardata, options, cb, c, d); in compile_branch()
5993 add_to_class(classbits, &class_uchardata, options, cb, meta, meta); in compile_branch()
6145 cb->had_accept = had_accept = TRUE; in compile_branch()
6146 for (oc = cb->open_caps; in compile_branch()
6147 oc != NULL && oc->assert_depth >= cb->assert_depth; in compile_branch()
6160 *code++ = (cb->assert_depth > 0)? OP_ASSERT_ACCEPT : OP_ACCEPT; in compile_branch()
6166 cb->had_pruneorskip = TRUE; in compile_branch()
6174 cb->external_flags |= PCRE2_HASTHEN; in compile_branch()
6186 cb->external_flags |= PCRE2_HASTHEN; in compile_branch()
6191 cb->had_pruneorskip = TRUE; in compile_branch()
6251 named_group *ng = cb->named_groups; in compile_branch()
6255 name = cb->start_pattern + offset; in compile_branch()
6263 for (i = 0; i < cb->names_found; i++, ng++) in compile_branch()
6272 if (ng->number > cb->top_backref) cb->top_backref = ng->number; in compile_branch()
6284 if (i >= cb->names_found) in compile_branch()
6295 cb->erroroffset = offset + i; in compile_branch()
6301 if (meta != META_COND_RNUMBER || groupnumber > cb->bracount) in compile_branch()
6304 cb->erroroffset = offset; in compile_branch()
6330 &count, errorcodeptr, cb)) return 0; in compile_branch()
6359 if (groupnumber > cb->bracount) in compile_branch()
6362 cb->erroroffset = offset; in compile_branch()
6365 if (groupnumber > cb->top_backref) cb->top_backref = groupnumber; in compile_branch()
6400 cb->assert_depth += 1; in compile_branch()
6405 cb->assert_depth += 1; in compile_branch()
6424 cb->assert_depth += 1; in compile_branch()
6431 cb->assert_depth += 1; in compile_branch()
6436 cb->assert_depth += 1; in compile_branch()
6441 cb->assert_depth += 1; in compile_branch()
6466 cb->parens_depth += 1; in compile_branch()
6470 tempreqvary = cb->req_varyopt; /* Save value before group */ in compile_branch()
6485 cb, /* Compile data block */ in compile_branch()
6491 cb->parens_depth -= 1; in compile_branch()
6503 cb->assert_depth -= 1; in compile_branch()
6533 cb->erroroffset = offset; in compile_branch()
6550 cb->erroroffset = offset; in compile_branch()
6671 named_group *ng = cb->named_groups; in compile_branch()
6675 name = cb->start_pattern + offset; in compile_branch()
6683 for (i = 0; i < cb->names_found; i++, ng++) in compile_branch()
6704 cb->backref_map |= (groupnumber < 32)? (1u << groupnumber) : 1; in compile_branch()
6705 if (groupnumber > cb->top_backref) in compile_branch()
6706 cb->top_backref = groupnumber; in compile_branch()
6715 cb->erroroffset = offset; in compile_branch()
6735 &count, errorcodeptr, cb)) return 0; in compile_branch()
6790 pp = cb->start_pattern + offset; in compile_branch()
6945 reqcuflags = req_caseopt | cb->req_varyopt; in compile_branch()
7656 cb->req_varyopt |= reqvary; in compile_branch()
7676 if (meta_arg < 10) offset = cb->small_ref_offset[meta_arg]; in compile_branch()
7679 if (meta_arg > cb->bracount) in compile_branch()
7681 cb->erroroffset = offset; in compile_branch()
7702 cb->backref_map |= (meta_arg < 32)? (1u << meta_arg) : 1; in compile_branch()
7703 if (meta_arg > cb->top_backref) cb->top_backref = meta_arg; in compile_branch()
7718 if (meta_arg > cb->bracount) in compile_branch()
7720 cb->erroroffset = offset; in compile_branch()
7729 cb->had_recurse = TRUE; in compile_branch()
7743 cb->lastcapture = meta_arg; in compile_branch()
7808 if (cb->assert_depth > 0 && meta_arg == ESC_K && in compile_branch()
7809 (cb->cx->extra_options & PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK) == 0) in compile_branch()
7821 if (meta_arg == ESC_C) cb->external_flags |= PCRE2_HASBKC; /* Record */ in compile_branch()
7823 cb->max_lookbehind == 0) in compile_branch()
7824 cb->max_lookbehind = 1; in compile_branch()
7906 cb->external_flags |= PCRE2_HASCRORLF; in compile_branch()
7930 reqcuflags = cb->req_varyopt; in compile_branch()
7948 reqcuflags = req_caseopt | cb->req_varyopt; in compile_branch()
8005 branch_chain *bcptr, compile_block *cb, PCRE2_SIZE *lengthptr) in compile_regex() argument
8025 if (cb->cx->stack_guard != NULL && in compile_regex()
8026 cb->cx->stack_guard(cb->parens_depth, cb->cx->stack_guard_data)) in compile_regex()
8072 capitem.next = cb->open_caps; in compile_regex()
8073 capitem.assert_depth = cb->assert_depth; in compile_regex()
8074 cb->open_caps = &capitem; in compile_regex()
8103 cb, (lengthptr == NULL)? NULL : &length)) == 0) in compile_regex()
8203 if (capnumber > 0) cb->open_caps = cb->open_caps->next; in compile_regex()
8301 is_anchored(PCRE2_SPTR code, unsigned int bracket_map, compile_block *cb, in is_anchored() argument
8314 if (!is_anchored(scode, bracket_map, cb, atomcount, inassert)) in is_anchored()
8325 if (!is_anchored(scode, new_map, cb, atomcount, inassert)) return FALSE; in is_anchored()
8332 if (!is_anchored(scode, bracket_map, cb, atomcount, TRUE)) return FALSE; in is_anchored()
8340 if (!is_anchored(scode, bracket_map, cb, atomcount, inassert)) in is_anchored()
8348 if (!is_anchored(scode, bracket_map, cb, atomcount + 1, inassert)) in is_anchored()
8362 if (scode[1] != OP_ALLANY || (bracket_map & cb->backref_map) != 0 || in is_anchored()
8363 atomcount > 0 || cb->had_pruneorskip || inassert || in is_anchored()
8364 (cb->external_options & PCRE2_NO_DOTSTAR_ANCHOR) != 0) in is_anchored()
8406 is_startline(PCRE2_SPTR code, unsigned int bracket_map, compile_block *cb, in is_startline() argument
8438 if (!is_startline(scode, bracket_map, cb, atomcount, TRUE)) return FALSE; in is_startline()
8452 if (!is_startline(scode, bracket_map, cb, atomcount, inassert)) in is_startline()
8463 if (!is_startline(scode, new_map, cb, atomcount, inassert)) return FALSE; in is_startline()
8470 if (!is_startline(scode, bracket_map, cb, atomcount, TRUE)) in is_startline()
8478 if (!is_startline(scode, bracket_map, cb, atomcount + 1, inassert)) in is_startline()
8491 if (scode[1] != OP_ANY || (bracket_map & cb->backref_map) != 0 || in is_startline()
8492 atomcount > 0 || cb->had_pruneorskip || inassert || in is_startline()
8493 (cb->external_options & PCRE2_NO_DOTSTAR_ANCHOR) != 0) in is_startline()
8790 add_name_to_table(compile_block *cb, PCRE2_SPTR name, int length, in add_name_to_table() argument
8794 PCRE2_UCHAR *slot = cb->name_table; in add_name_to_table()
8809 (void)memmove(slot + cb->name_entry_size, slot, in add_name_to_table()
8810 CU2BYTES((tablecount - i) * cb->name_entry_size)); in add_name_to_table()
8816 slot += cb->name_entry_size; in add_name_to_table()
8827 CU2BYTES(cb->name_entry_size - length - IMM2_SIZE)); in add_name_to_table()
8979 int group, parsed_recurse_check *recurses, compile_block *cb) in get_grouplength() argument
8989 if (group > 0 && (cb->external_flags & PCRE2_DUPCAPUSED) == 0) in get_grouplength()
8991 uint32_t groupinfo = cb->groupinfo[group]; in get_grouplength()
9004 branchlength = get_branchlength(pptrptr, errcodeptr, lcptr, recurses, cb); in get_grouplength()
9013 cb->groupinfo[group] |= (uint32_t)(GI_SET_FIXED_LENGTH | grouplength); in get_grouplength()
9017 if (group > 0) cb->groupinfo[group] |= GI_NOT_FIXED_LENGTH; in get_grouplength()
9043 parsed_recurse_check *recurses, compile_block *cb) in get_branchlength() argument
9147 if ((cb->external_options & PCRE2_UTF) != 0 && escape == ESC_C) in get_branchlength()
9164 *errcodeptr = check_lookbehinds(pptr + 1, &pptr, recurses, cb, lcptr); in get_branchlength()
9200 if (!set_lookbehind_lengths(&pptr, errcodeptr, lcptr, recurses, cb)) in get_branchlength()
9211 if ((cb->external_options & PCRE2_MATCH_UNSET_BACKREF) != 0) in get_branchlength()
9220 named_group *ng = cb->named_groups; in get_branchlength()
9225 name = cb->start_pattern + offset; in get_branchlength()
9226 for (i = 0; i < cb->names_found; i++, ng++) in get_branchlength()
9239 cb->erroroffset = offset; in get_branchlength()
9248 (!is_dupname && (cb->external_flags & PCRE2_DUPCAPUSED) == 0)) in get_branchlength()
9258 if ((cb->external_options & PCRE2_MATCH_UNSET_BACKREF) != 0 || in get_branchlength()
9259 (cb->external_flags & PCRE2_DUPCAPUSED) != 0) in get_branchlength()
9264 offset = cb->small_ref_offset[group]; in get_branchlength()
9279 if (group > cb->bracount) in get_branchlength()
9281 cb->erroroffset = offset; in get_branchlength()
9286 for (gptr = cb->parsed_pattern; *gptr != META_END; gptr++) in get_branchlength()
9310 &this_recurse, cb); in get_branchlength()
9355 recurses, cb); in get_branchlength()
9454 parsed_recurse_check *recurses, compile_block *cb) in set_lookbehind_lengths() argument
9466 branchlength = get_branchlength(pptrptr, errcodeptr, lcptr, recurses, cb); in set_lookbehind_lengths()
9471 if (cb->erroroffset == PCRE2_UNSET) cb->erroroffset = offset; in set_lookbehind_lengths()
9474 if (branchlength > cb->max_lookbehind) cb->max_lookbehind = branchlength; in set_lookbehind_lengths()
9511 parsed_recurse_check *recurses, compile_block *cb, int *lcptr) in check_lookbehinds() argument
9516 cb->erroroffset = PCRE2_UNSET; in check_lookbehinds()
9639 if (!set_lookbehind_lengths(&pptr, &errorcode, lcptr, recurses, cb)) in check_lookbehinds()
9678 compile_block cb; /* "Static" compile-time data */ in pcre2_compile() local
9783 cb.lcc = tables + lcc_offset; /* Individual */ in pcre2_compile()
9784 cb.fcc = tables + fcc_offset; /* character */ in pcre2_compile()
9785 cb.cbits = tables + cbits_offset; /* tables */ in pcre2_compile()
9786 cb.ctypes = tables + ctypes_offset; in pcre2_compile()
9788 cb.assert_depth = 0; in pcre2_compile()
9789 cb.bracount = 0; in pcre2_compile()
9790 cb.cx = ccontext; in pcre2_compile()
9791 cb.dupnames = FALSE; in pcre2_compile()
9792 cb.end_pattern = pattern + patlen; in pcre2_compile()
9793 cb.erroroffset = 0; in pcre2_compile()
9794 cb.external_flags = 0; in pcre2_compile()
9795 cb.external_options = options; in pcre2_compile()
9796 cb.groupinfo = stack_groupinfo; in pcre2_compile()
9797 cb.had_recurse = FALSE; in pcre2_compile()
9798 cb.lastcapture = 0; in pcre2_compile()
9799 cb.max_lookbehind = 0; in pcre2_compile()
9800 cb.name_entry_size = 0; in pcre2_compile()
9801 cb.name_table = NULL; in pcre2_compile()
9802 cb.named_groups = named_groups; in pcre2_compile()
9803 cb.named_group_list_size = NAMED_GROUP_LIST_SIZE; in pcre2_compile()
9804 cb.names_found = 0; in pcre2_compile()
9805 cb.open_caps = NULL; in pcre2_compile()
9806 cb.parens_depth = 0; in pcre2_compile()
9807 cb.parsed_pattern = stack_parsed_pattern; in pcre2_compile()
9808 cb.req_varyopt = 0; in pcre2_compile()
9809 cb.start_code = cworkspace; in pcre2_compile()
9810 cb.start_pattern = pattern; in pcre2_compile()
9811 cb.start_workspace = cworkspace; in pcre2_compile()
9812 cb.workspace_size = COMPILE_WORK_SIZE; in pcre2_compile()
9818 cb.top_backref = 0; in pcre2_compile()
9819 cb.backref_map = 0; in pcre2_compile()
9831 for (i = 0; i < 10; i++) cb.small_ref_offset[i] = PCRE2_UNSET; in pcre2_compile()
9868 cb.external_options |= p->value; in pcre2_compile()
9927 if ((cb.external_options & (PCRE2_UTF|PCRE2_UCP)) != 0) in pcre2_compile()
9939 utf = (cb.external_options & PCRE2_UTF) != 0; in pcre2_compile()
9962 ucp = (cb.external_options & PCRE2_UCP) != 0; in pcre2_compile()
9963 if (ucp && (cb.external_options & PCRE2_NEVER_UCP) != 0) in pcre2_compile()
9976 cb.nltype = NLTYPE_FIXED; in pcre2_compile()
9980 cb.nllen = 1; in pcre2_compile()
9981 cb.nl[0] = CHAR_CR; in pcre2_compile()
9985 cb.nllen = 1; in pcre2_compile()
9986 cb.nl[0] = CHAR_NL; in pcre2_compile()
9990 cb.nllen = 1; in pcre2_compile()
9991 cb.nl[0] = CHAR_NUL; in pcre2_compile()
9995 cb.nllen = 2; in pcre2_compile()
9996 cb.nl[0] = CHAR_CR; in pcre2_compile()
9997 cb.nl[1] = CHAR_NL; in pcre2_compile()
10001 cb.nltype = NLTYPE_ANY; in pcre2_compile()
10005 cb.nltype = NLTYPE_ANYCRLF; in pcre2_compile()
10030 for (p = ptr; p < cb.end_pattern; p++) if (*p >= META_END) big32count++; in pcre2_compile()
10058 cb.parsed_pattern = heap_parsed_pattern; in pcre2_compile()
10060 cb.parsed_pattern_end = cb.parsed_pattern + parsed_size_needed + 1; in pcre2_compile()
10064 errorcode = parse_regex(ptr, cb.external_options, &has_lookbehind, &cb); in pcre2_compile()
10076 if (cb.bracount >= GROUPINFO_DEFAULT_SIZE) in pcre2_compile()
10078 cb.groupinfo = ccontext->memctl.malloc( in pcre2_compile()
10079 (cb.bracount + 1)*sizeof(uint32_t), ccontext->memctl.memory_data); in pcre2_compile()
10080 if (cb.groupinfo == NULL) in pcre2_compile()
10083 cb.erroroffset = 0; in pcre2_compile()
10087 memset(cb.groupinfo, 0, (cb.bracount + 1) * sizeof(uint32_t)); in pcre2_compile()
10095 errorcode = check_lookbehinds(cb.parsed_pattern, NULL, NULL, &cb, &loopcount); in pcre2_compile()
10103 show_parsed(&cb); in pcre2_compile()
10110 named_group *ng = cb.named_groups; in pcre2_compile()
10111 fprintf(stderr, "+++Captures: %d\n", cb.bracount); in pcre2_compile()
10112 for (i = 0; i < cb.names_found; i++, ng++) in pcre2_compile()
10131 cb.erroroffset = patlen; /* For any subsequent errors that do not set it */ in pcre2_compile()
10132 pptr = cb.parsed_pattern; in pcre2_compile()
10136 (void)compile_regex(cb.external_options, &code, &pptr, &errorcode, 0, &firstcu, in pcre2_compile()
10137 &firstcuflags, &reqcu, &reqcuflags, NULL, &cb, &length); in pcre2_compile()
10156 (PCRE2_SIZE)cb.names_found * (PCRE2_SIZE)cb.name_entry_size); in pcre2_compile()
10179 re->overall_options = cb.external_options; in pcre2_compile()
10181 re->flags = PCRE2_CODE_UNIT_WIDTH/8 | cb.external_flags | setflags; in pcre2_compile()
10193 re->name_entry_size = cb.name_entry_size; in pcre2_compile()
10194 re->name_count = cb.names_found; in pcre2_compile()
10207 cb.parens_depth = 0; in pcre2_compile()
10208 cb.assert_depth = 0; in pcre2_compile()
10209 cb.lastcapture = 0; in pcre2_compile()
10210 cb.name_table = (PCRE2_UCHAR *)((uint8_t *)re + sizeof(pcre2_real_code)); in pcre2_compile()
10211 cb.start_code = codestart; in pcre2_compile()
10212 cb.req_varyopt = 0; in pcre2_compile()
10213 cb.had_accept = FALSE; in pcre2_compile()
10214 cb.had_pruneorskip = FALSE; in pcre2_compile()
10215 cb.open_caps = NULL; in pcre2_compile()
10220 if (cb.names_found > 0) in pcre2_compile()
10222 named_group *ng = cb.named_groups; in pcre2_compile()
10223 for (i = 0; i < cb.names_found; i++, ng++) in pcre2_compile()
10224 add_name_to_table(&cb, ng->name, ng->length, ng->number, i); in pcre2_compile()
10231 pptr = cb.parsed_pattern; in pcre2_compile()
10235 &firstcu, &firstcuflags, &reqcu, &reqcuflags, NULL, &cb, NULL); in pcre2_compile()
10237 re->top_bracket = cb.bracount; in pcre2_compile()
10238 re->top_backref = cb.top_backref; in pcre2_compile()
10239 re->max_lookbehind = cb.max_lookbehind; in pcre2_compile()
10241 if (cb.had_accept) in pcre2_compile()
10269 if (errorcode == 0 && cb.had_recurse) in pcre2_compile()
10340 if (PRIV(auto_possessify)(temp, &cb) != 0) errorcode = ERR80; in pcre2_compile()
10354 is_anchored(codestart, 0, &cb, 0, FALSE)) in pcre2_compile()
10390 if (cb.fcc[firstcu] != firstcu) re->flags |= PCRE2_FIRSTCASELESS; in pcre2_compile()
10417 is_startline(codestart, 0, &cb, 0, FALSE)) in pcre2_compile()
10457 if (cb.fcc[reqcu] != reqcu) re->flags |= PCRE2_LASTCASELESS; in pcre2_compile()
10504 if (cb.parsed_pattern != stack_parsed_pattern) in pcre2_compile()
10505 ccontext->memctl.free(cb.parsed_pattern, ccontext->memctl.memory_data); in pcre2_compile()
10506 if (cb.named_group_list_size > NAMED_GROUP_LIST_SIZE) in pcre2_compile()
10507 ccontext->memctl.free((void *)cb.named_groups, ccontext->memctl.memory_data); in pcre2_compile()
10508 if (cb.groupinfo != stack_groupinfo) in pcre2_compile()
10509 ccontext->memctl.free((void *)cb.groupinfo, ccontext->memctl.memory_data); in pcre2_compile()
10519 ptr = pattern + cb.erroroffset; in pcre2_compile()