Lines Matching refs:code

1672 first_significant_code(const pcre_uchar *code, BOOL skipassert)  in first_significant_code()  argument
1676 switch ((int)*code) in first_significant_code()
1681 if (!skipassert) return code; in first_significant_code()
1682 do code += GET(code, 1); while (*code == OP_ALT); in first_significant_code()
1683 code += PRIV(OP_lengths)[*code]; in first_significant_code()
1688 if (!skipassert) return code; in first_significant_code()
1697 code += PRIV(OP_lengths)[*code]; in first_significant_code()
1701 return code; in first_significant_code()
1739 find_fixedlength(pcre_uchar *code, BOOL utf, BOOL atend, compile_data *cd) in find_fixedlength() argument
1744 register pcre_uchar *cc = code + 1 + LINK_SIZE; in find_fixedlength()
2068 PRIV(find_bracket)(const pcre_uchar *code, BOOL utf, int number) in PRIV()
2072 register pcre_uchar c = *code; in PRIV()
2080 if (c == OP_XCLASS) code += GET(code, 1); in PRIV()
2086 if (number < 0) return (pcre_uchar *)code; in PRIV()
2087 code += PRIV(OP_lengths)[c]; in PRIV()
2095 int n = (int)GET2(code, 1+LINK_SIZE); in PRIV()
2096 if (n == number) return (pcre_uchar *)code; in PRIV()
2097 code += PRIV(OP_lengths)[c]; in PRIV()
2118 if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2; in PRIV()
2125 if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP) in PRIV()
2126 code += 2; in PRIV()
2132 code += code[1]; in PRIV()
2136 code += code[1]; in PRIV()
2142 code += PRIV(OP_lengths)[c]; in PRIV()
2179 if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]); in PRIV()
2206 find_recurse(const pcre_uchar *code, BOOL utf) in find_recurse() argument
2210 register pcre_uchar c = *code; in find_recurse()
2212 if (c == OP_RECURSE) return code; in find_recurse()
2218 if (c == OP_XCLASS) code += GET(code, 1); in find_recurse()
2238 if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2; in find_recurse()
2245 if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP) in find_recurse()
2246 code += 2; in find_recurse()
2252 code += code[1]; in find_recurse()
2256 code += code[1]; in find_recurse()
2262 code += PRIV(OP_lengths)[c]; in find_recurse()
2327 if (HAS_EXTRALEN(code[-1])) code += GET_EXTRALEN(code[-1]); in find_recurse()
2361 could_be_empty_branch(const pcre_uchar *code, const pcre_uchar *endcode, in could_be_empty_branch() argument
2365 for (code = first_significant_code(code + PRIV(OP_lengths)[*code], TRUE); in could_be_empty_branch()
2366 code < endcode; in could_be_empty_branch()
2367 code = first_significant_code(code + PRIV(OP_lengths)[c], TRUE)) in could_be_empty_branch()
2371 c = *code; in could_be_empty_branch()
2378 do code += GET(code, 1); while (*code == OP_ALT); in could_be_empty_branch()
2379 c = *code; in could_be_empty_branch()
2398 if ((int)GET(scode, 0) == (int)(code + 1 - cd->start_code)) return TRUE; in could_be_empty_branch()
2403 scode = cd->start_code + GET(code, 1); in could_be_empty_branch()
2428 code += PRIV(OP_lengths)[c]; in could_be_empty_branch()
2429 do code += GET(code, 1); while (*code == OP_ALT); in could_be_empty_branch()
2430 c = *code; in could_be_empty_branch()
2440 do code += GET(code, 1); while (*code == OP_ALT); in could_be_empty_branch()
2441 c = *code; in could_be_empty_branch()
2453 if (GET(code, 1) == 0) return TRUE; /* Hit unclosed bracket */ in could_be_empty_branch()
2459 if (c == OP_COND && code[GET(code, 1)] != OP_ALT) in could_be_empty_branch()
2460 code += GET(code, 1); in could_be_empty_branch()
2466 if (!empty_branch && could_be_empty_branch(code, endcode, utf, cd)) in could_be_empty_branch()
2468 code += GET(code, 1); in could_be_empty_branch()
2470 while (*code == OP_ALT); in could_be_empty_branch()
2474 c = *code; in could_be_empty_branch()
2490 ccode = code += GET(code, 1); in could_be_empty_branch()
2496 ccode = code + PRIV(OP_lengths)[OP_CLASS]; in could_be_empty_branch()
2563 if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2; in could_be_empty_branch()
2571 if (code[1 + IMM2_SIZE] == OP_PROP || code[1 + IMM2_SIZE] == OP_NOTPROP) in could_be_empty_branch()
2572 code += 2; in could_be_empty_branch()
2600 if (utf && HAS_EXTRALEN(code[1])) code += GET_EXTRALEN(code[1]); in could_be_empty_branch()
2609 if (utf && HAS_EXTRALEN(code[1 + IMM2_SIZE])) code += GET_EXTRALEN(code[1 + IMM2_SIZE]); in could_be_empty_branch()
2619 code += code[1]; in could_be_empty_branch()
2623 code += code[1]; in could_be_empty_branch()
2660 could_be_empty(const pcre_uchar *code, const pcre_uchar *endcode, in could_be_empty() argument
2663 while (bcptr != NULL && bcptr->current_branch >= code) in could_be_empty()
2862 auto_callout(pcre_uchar *code, const pcre_uchar *ptr, compile_data *cd) in auto_callout() argument
2864 *code++ = OP_CALLOUT; in auto_callout()
2865 *code++ = 255; in auto_callout()
2866 PUT(code, 0, (int)(ptr - cd->start_pattern)); /* Pattern offset */ in auto_callout()
2867 PUT(code, LINK_SIZE, 0); /* Default length */ in auto_callout()
2868 return code + 2 * LINK_SIZE; in auto_callout()
3715 register pcre_uchar *code = *codeptr; in compile_branch() local
3716 pcre_uchar *last_code = code; in compile_branch()
3717 pcre_uchar *orig_code = code; in compile_branch()
3828 if (code > cd->hwm) cd->hwm = code; /* High water info */ in compile_branch()
3830 if (code > cd->start_workspace + cd->workspace_size - in compile_branch()
3843 if (code < last_code) code = last_code; in compile_branch()
3847 if (OFLOW_MAX - *lengthptr < code - last_code) in compile_branch()
3853 *lengthptr += (int)(code - last_code); in compile_branch()
3855 (int)(code - last_code), c, c)); in compile_branch()
3865 memmove(orig_code, previous, IN_UCHARS(code - previous)); in compile_branch()
3866 code -= previous - orig_code; in compile_branch()
3870 else code = orig_code; in compile_branch()
3875 last_code = code; in compile_branch()
3908 previous_callout = code; in compile_branch()
3909 code = auto_callout(code, ptr, cd); in compile_branch()
3957 previous_callout = code; in compile_branch()
3958 code = auto_callout(code, ptr, cd); in compile_branch()
3971 *codeptr = code; in compile_branch()
3975 if (OFLOW_MAX - *lengthptr < code - last_code) in compile_branch()
3980 *lengthptr += (int)(code - last_code); /* To include callout length */ in compile_branch()
3995 *code++ = OP_CIRCM; in compile_branch()
3997 else *code++ = OP_CIRC; in compile_branch()
4002 *code++ = ((options & PCRE_MULTILINE) != 0)? OP_DOLLM : OP_DOLL; in compile_branch()
4014 previous = code; in compile_branch()
4015 *code++ = ((options & PCRE_DOTALL) != 0)? OP_ALLANY: OP_ANY; in compile_branch()
4043 previous = code; in compile_branch()
4086 *code++ = negate_class? OP_ALLANY : OP_FAIL; in compile_branch()
4116 class_uchardata = code + LINK_SIZE + 2; /* For XCLASS items */ in compile_branch()
4568 *code++ = OP_NOTPROP; in compile_branch()
4569 *code++ = PT_CLIST; in compile_branch()
4570 *code++ = d; in compile_branch()
4577 *code++ = ((options & PCRE_CASELESS) != 0)? OP_NOTI: OP_NOT; in compile_branch()
4580 code += PRIV(ord2utf)(c, code); in compile_branch()
4583 *code++ = c; in compile_branch()
4668 *code++ = OP_XCLASS; in compile_branch()
4669 code += LINK_SIZE; in compile_branch()
4670 *code = negate_class? XCL_NOT:0; in compile_branch()
4677 *code++ |= XCL_MAP; in compile_branch()
4678 memmove(code + (32 / sizeof(pcre_uchar)), code, in compile_branch()
4679 IN_UCHARS(class_uchardata - code)); in compile_branch()
4680 memcpy(code, classbits, 32); in compile_branch()
4681 code = class_uchardata + (32 / sizeof(pcre_uchar)); in compile_branch()
4683 else code = class_uchardata; in compile_branch()
4687 PUT(previous, 1, (int)(code - previous)); in compile_branch()
4698 *code++ = (negate_class == should_flip_negation) ? OP_CLASS : OP_NCLASS; in compile_branch()
4703 memcpy(code, classbits, 32); in compile_branch()
4705 code += 32 / sizeof(pcre_uchar); in compile_branch()
4794 code += 2 + 2 * LINK_SIZE; in compile_branch()
4834 if (utf && NOT_FIRSTCHAR(code[-1])) in compile_branch()
4836 pcre_uchar *lastchar = code - 1; in compile_branch()
4838 c = (int)(code - lastchar); /* Length of UTF-8 character */ in compile_branch()
4848 c = code[-1]; in compile_branch()
4902 oldcode = code; in compile_branch()
4903 code = previous; /* Usually overwrite previous item */ in compile_branch()
4929 if (repeat_max == -1) *code++ = OP_STAR + repeat_type; in compile_branch()
4930 else if (repeat_max == 1) *code++ = OP_QUERY + repeat_type; in compile_branch()
4933 *code++ = OP_UPTO + repeat_type; in compile_branch()
4934 PUT2INC(code, 0, repeat_max); in compile_branch()
4946 *code++ = OP_PLUS + repeat_type; in compile_branch()
4949 code = oldcode; /* leave previous item in place */ in compile_branch()
4951 *code++ = OP_UPTO + repeat_type; in compile_branch()
4952 PUT2INC(code, 0, repeat_max - 1); in compile_branch()
4961 *code++ = OP_EXACT + op_type; /* NB EXACT doesn't have repeat_type */ in compile_branch()
4962 PUT2INC(code, 0, repeat_min); in compile_branch()
4975 memcpy(code, utf_chars, IN_UCHARS(c & 7)); in compile_branch()
4976 code += c & 7; in compile_branch()
4981 *code++ = c; in compile_branch()
4984 *code++ = prop_type; in compile_branch()
4985 *code++ = prop_value; in compile_branch()
4988 *code++ = OP_STAR + repeat_type; in compile_branch()
5000 memcpy(code, utf_chars, IN_UCHARS(c & 7)); in compile_branch()
5001 code += c & 7; in compile_branch()
5005 *code++ = c; in compile_branch()
5008 *code++ = prop_type; in compile_branch()
5009 *code++ = prop_value; in compile_branch()
5015 *code++ = OP_QUERY + repeat_type; in compile_branch()
5019 *code++ = OP_UPTO + repeat_type; in compile_branch()
5020 PUT2INC(code, 0, repeat_max); in compile_branch()
5030 memcpy(code, utf_chars, IN_UCHARS(c & 7)); in compile_branch()
5031 code += c & 7; in compile_branch()
5035 *code++ = c; in compile_branch()
5043 *code++ = prop_type; in compile_branch()
5044 *code++ = prop_value; in compile_branch()
5062 code = previous; in compile_branch()
5077 *code++ = OP_CRSTAR + repeat_type; in compile_branch()
5079 *code++ = OP_CRPLUS + repeat_type; in compile_branch()
5081 *code++ = OP_CRQUERY + repeat_type; in compile_branch()
5084 *code++ = OP_CRRANGE + repeat_type; in compile_branch()
5085 PUT2INC(code, 0, repeat_min); in compile_branch()
5087 PUT2INC(code, 0, repeat_max); in compile_branch()
5102 int len = (int)(code - previous); in compile_branch()
5156 *code = OP_END; in compile_branch()
5159 code++; in compile_branch()
5180 *code = OP_END; in compile_branch()
5183 code += 2 + LINK_SIZE; in compile_branch()
5245 memcpy(code, previous, IN_UCHARS(len)); in compile_branch()
5264 code += len; in compile_branch()
5310 *code++ = OP_BRAZERO + repeat_type; in compile_branch()
5318 *code++ = OP_BRA; in compile_branch()
5319 offset = (bralink == NULL)? 0 : (int)(code - bralink); in compile_branch()
5320 bralink = code; in compile_branch()
5321 PUTINC(code, 0, offset); in compile_branch()
5324 memcpy(code, previous, IN_UCHARS(len)); in compile_branch()
5346 code += len; in compile_branch()
5355 int offset = (int)(code - bralink + 1); in compile_branch()
5356 pcre_uchar *bra = code - offset; in compile_branch()
5359 *code++ = OP_KET; in compile_branch()
5360 PUTINC(code, 0, offset); in compile_branch()
5392 pcre_uchar *ketcode = code - 1 - LINK_SIZE; in compile_branch()
5439 int nlen = (int)(code - bracode); in compile_branch()
5440 *code = OP_END; in compile_branch()
5443 code += 1 + LINK_SIZE; in compile_branch()
5446 *code++ = OP_KETRPOS; in compile_branch()
5447 PUTINC(code, 0, nlen); in compile_branch()
5524 len = (int)(code - tempcode); in compile_branch()
5556 *code = OP_END; in compile_branch()
5559 code += 1 + LINK_SIZE; in compile_branch()
5562 *code++ = OP_KET; in compile_branch()
5563 PUTINC(code, 0, len); in compile_branch()
5652 *code++ = OP_CLOSE; in compile_branch()
5653 PUT2INC(code, 0, oc->number); in compile_branch()
5655 setverb = *code++ = in compile_branch()
5671 setverb = *code++ = verbs[i].op; in compile_branch()
5681 setverb = *code++ = verbs[i].op_arg; in compile_branch()
5682 *code++ = arglen; in compile_branch()
5683 memcpy(code, arg, IN_UCHARS(arglen)); in compile_branch()
5684 code += arglen; in compile_branch()
5685 *code++ = 0; in compile_branch()
5777 code[1+LINK_SIZE] = OP_CREF; in compile_branch()
5787 code[1+LINK_SIZE] = OP_RREF; /* Change the type of test */ in compile_branch()
5860 PUT2(code, 2+LINK_SIZE, recno); in compile_branch()
5882 PUT2(code, 2+LINK_SIZE, recno); in compile_branch()
5883 code[1+LINK_SIZE]++; in compile_branch()
5891 PUT2(code, 2+LINK_SIZE, i); in compile_branch()
5892 code[1+LINK_SIZE]++; in compile_branch()
5923 code[1+LINK_SIZE] = OP_RREF; /* Change test type */ in compile_branch()
5924 PUT2(code, 2+LINK_SIZE, recno); in compile_branch()
5932 code[1+LINK_SIZE] = OP_DEF; in compile_branch()
5941 PUT2(code, 2+LINK_SIZE, recno); in compile_branch()
5967 *code++ = OP_FAIL; in compile_branch()
6011 previous_callout = code; /* Save for later completion */ in compile_branch()
6013 *code++ = OP_CALLOUT; in compile_branch()
6029 *code++ = n; in compile_branch()
6030 PUT(code, 0, (int)(ptr - cd->start_pattern + 1)); /* Pattern offset */ in compile_branch()
6031 PUT(code, LINK_SIZE, 0); /* Default length */ in compile_branch()
6032 code += 2 * LINK_SIZE; in compile_branch()
6352 previous = code; in compile_branch()
6364 *code = OP_END; in compile_branch()
6390 PUTINC(cd->hwm, 0, (int)(code + 1 - cd->start_code)); in compile_branch()
6403 could_be_empty(called, code, bcptr, utf, cd)) in compile_branch()
6414 *code = OP_RECURSE; in compile_branch()
6415 PUT(code, 1, (int)(called - cd->start_code)); in compile_branch()
6416 code += 1 + LINK_SIZE; in compile_branch()
6483 if (code == cd->start_code + 1 + LINK_SIZE && in compile_branch()
6528 PUT2(code, 1+LINK_SIZE, cd->bracount); in compile_branch()
6537 previous = code; /* For handling repetition */ in compile_branch()
6538 *code = bravalue; in compile_branch()
6539 tempcode = code; in compile_branch()
6570 *code = OP_ONCE_NC; in compile_branch()
6586 pcre_uchar *tc = code; in compile_branch()
6598 if (code[LINK_SIZE+1] == OP_DEF) in compile_branch()
6644 code++; /* This already contains bravalue */ in compile_branch()
6645 PUTINC(code, 0, 1 + LINK_SIZE); in compile_branch()
6646 *code++ = OP_KET; in compile_branch()
6647 PUTINC(code, 0, 1 + LINK_SIZE); in compile_branch()
6653 code = tempcode; in compile_branch()
6860 previous = code; in compile_branch()
6861 *code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF; in compile_branch()
6862 PUT2INC(code, 0, recno); in compile_branch()
6889 previous = code; in compile_branch()
6890 *code++ = ((escape == ESC_p) != negated)? OP_PROP : OP_NOTPROP; in compile_branch()
6891 *code++ = ptype; in compile_branch()
6892 *code++ = pdata; in compile_branch()
6928 previous = (escape > ESC_b && escape < ESC_Z)? code : NULL; in compile_branch()
6929 *code++ = (!utf && escape == ESC_C)? OP_ALLANY : escape; in compile_branch()
6971 previous = code; in compile_branch()
6983 *code++ = OP_PROP; in compile_branch()
6984 *code++ = PT_CLIST; in compile_branch()
6985 *code++ = c; in compile_branch()
6994 *code++ = ((options & PCRE_CASELESS) != 0)? OP_CHARI : OP_CHAR; in compile_branch()
6995 for (c = 0; c < mclength; c++) *code++ = mcbuffer[c]; in compile_branch()
7024 reqchar = code[-1]; in compile_branch()
7042 reqchar = code[-1]; in compile_branch()
7104 pcre_uchar *code = *codeptr; in compile_regex() local
7105 pcre_uchar *last_branch = code; in compile_regex()
7106 pcre_uchar *start_bracket = code; in compile_regex()
7120 bc.current_branch = code; in compile_regex()
7145 if (*code == OP_CBRA) in compile_regex()
7147 capnumber = GET2(code, 1 + LINK_SIZE); in compile_regex()
7156 PUT(code, 1, 0); in compile_regex()
7157 code += 1 + LINK_SIZE + skipbytes; in compile_regex()
7173 *code++ = OP_REVERSE; in compile_regex()
7174 reverse_count = code; in compile_regex()
7175 PUTINC(code, 0, 0); in compile_regex()
7182 if (!compile_branch(&options, &code, &ptr, errorcodeptr, &branchfirstchar, in compile_regex()
7264 *code = OP_END; in compile_regex()
7299 int branch_length = (int)(code - last_branch); in compile_regex()
7312 *code = OP_KET; in compile_regex()
7313 PUT(code, 1, (int)(code - start_bracket)); in compile_regex()
7314 code += 1 + LINK_SIZE; in compile_regex()
7325 IN_UCHARS(code - start_bracket)); in compile_regex()
7327 code += 1 + LINK_SIZE; in compile_regex()
7328 PUT(start_bracket, 1, (int)(code - start_bracket)); in compile_regex()
7329 *code = OP_KET; in compile_regex()
7330 PUT(code, 1, (int)(code - start_bracket)); in compile_regex()
7331 code += 1 + LINK_SIZE; in compile_regex()
7343 *codeptr = code; in compile_regex()
7372 code = *codeptr + 1 + LINK_SIZE + skipbytes; in compile_regex()
7377 *code = OP_ALT; in compile_regex()
7378 PUT(code, 1, (int)(code - last_branch)); in compile_regex()
7379 bc.current_branch = last_branch = code; in compile_regex()
7380 code += 1 + LINK_SIZE; in compile_regex()
7433 is_anchored(register const pcre_uchar *code, unsigned int bracket_map, in is_anchored() argument
7438 code + PRIV(OP_lengths)[*code], FALSE); in is_anchored()
7490 code += GET(code, 1); in is_anchored()
7492 while (*code == OP_ALT); /* Loop for each alternative */ in is_anchored()
7523 is_startline(const pcre_uchar *code, unsigned int bracket_map, in is_startline() argument
7528 code + PRIV(OP_lengths)[*code], FALSE); in is_startline()
7613 code += GET(code, 1); in is_startline()
7615 while (*code == OP_ALT); /* Loop for each alternative */ in is_startline()
7642 find_firstassertedchar(const pcre_uchar *code, pcre_int32 *flags, in find_firstassertedchar() argument
7652 int xl = (*code == OP_CBRA || *code == OP_SCBRA || in find_firstassertedchar()
7653 *code == OP_CBRAPOS || *code == OP_SCBRAPOS)? IMM2_SIZE:0; in find_firstassertedchar()
7654 const pcre_uchar *scode = first_significant_code(code + 1+LINK_SIZE + xl, in find_firstassertedchar()
7706 code += GET(code, 1); in find_firstassertedchar()
7708 while (*code == OP_ALT); in find_firstassertedchar()
7785 pcre_uchar *code; in pcre_compile2() local
8033 code = cworkspace; in pcre_compile2()
8034 *code = OP_BRA; in pcre_compile2()
8035 (void)compile_regex(cd->external_options, &code, &ptr, &errorcode, FALSE, in pcre_compile2()
8112 code = (pcre_uchar *)codestart; in pcre_compile2()
8113 *code = OP_BRA; in pcre_compile2()
8114 (void)compile_regex(re->options, &code, &ptr, &errorcode, FALSE, FALSE, 0, 0, in pcre_compile2()
8134 *code++ = OP_END; in pcre_compile2()
8137 if (code - codestart > length) errorcode = ERR23; in pcre_compile2()
8144 VALGRIND_MAKE_MEM_NOACCESS(code, (length - (code - codestart)) * sizeof(pcre_uchar)); in pcre_compile2()
8367 if (code - codestart > length) in pcre_compile2()