Lines Matching refs:cc

246   PCRE2_SPTR cc;  member
592 #define PRIVATE_DATA(cc) (common->private_data_ptrs[(cc) - common->start]) argument
832 static PCRE2_SPTR bracketend(PCRE2_SPTR cc) in bracketend() argument
834 SLJIT_ASSERT((*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NA) || (*cc >= OP_ONCE && *cc <= OP_SCOND)); in bracketend()
835 do cc += GET(cc, 1); while (*cc == OP_ALT); in bracketend()
836 SLJIT_ASSERT(*cc >= OP_KET && *cc <= OP_KETRPOS); in bracketend()
837 cc += 1 + LINK_SIZE; in bracketend()
838 return cc; in bracketend()
841 static int no_alternatives(PCRE2_SPTR cc) in no_alternatives() argument
844 SLJIT_ASSERT((*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NA) || (*cc >= OP_ONCE && *cc <= OP_SCOND)); in no_alternatives()
847 cc += GET(cc, 1); in no_alternatives()
850 while (*cc == OP_ALT); in no_alternatives()
851 SLJIT_ASSERT(*cc >= OP_KET && *cc <= OP_KETRPOS); in no_alternatives()
867 static PCRE2_SPTR next_opcode(compiler_common *common, PCRE2_SPTR cc) in next_opcode() argument
870 switch(*cc) in next_opcode()
961 return cc + PRIV(OP_lengths)[*cc]; in next_opcode()
1019 cc += PRIV(OP_lengths)[*cc]; in next_opcode()
1021 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in next_opcode()
1023 return cc; in next_opcode()
1039 return cc + PRIV(OP_lengths)[*cc] - 1; in next_opcode()
1045 return cc + 1; in next_opcode()
1048 return cc + GET(cc, 1 + 2*LINK_SIZE); in next_opcode()
1052 return cc + GET(cc, 1); in next_opcode()
1060 return cc + 1 + 2 + cc[1]; in next_opcode()
1068 static BOOL check_opcode_types(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend) in check_opcode_types() argument
1072 PCRE2_SPTR assert_back_end = cc - 1; in check_opcode_types()
1073 PCRE2_SPTR assert_na_end = cc - 1; in check_opcode_types()
1076 while (cc < ccend) in check_opcode_types()
1078 switch(*cc) in check_opcode_types()
1083 cc += 1; in check_opcode_types()
1096 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
1097 cc += 1 + IMM2_SIZE; in check_opcode_types()
1102 slot = bracketend(cc); in check_opcode_types()
1105 cc += 1 + LINK_SIZE; in check_opcode_types()
1110 common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] = 0; in check_opcode_types()
1111 cc += 1 + LINK_SIZE + IMM2_SIZE; in check_opcode_types()
1118 if (cc[1 + LINK_SIZE] == OP_CALLOUT || cc[1 + LINK_SIZE] == OP_CALLOUT_STR) in check_opcode_types()
1120 cc += 1 + LINK_SIZE; in check_opcode_types()
1124 common->optimized_cbracket[GET2(cc, 1)] = 0; in check_opcode_types()
1125 cc += 1 + IMM2_SIZE; in check_opcode_types()
1131 count = GET2(cc, 1 + IMM2_SIZE); in check_opcode_types()
1132 slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in check_opcode_types()
1138 cc += 1 + 2 * IMM2_SIZE; in check_opcode_types()
1148 cc += 1 + LINK_SIZE; in check_opcode_types()
1158 cc += (*cc == OP_CALLOUT) ? PRIV(OP_lengths)[OP_CALLOUT] : GET(cc, 1 + 2*LINK_SIZE); in check_opcode_types()
1162 slot = bracketend(cc); in check_opcode_types()
1165 cc += 1 + LINK_SIZE; in check_opcode_types()
1175 if (cc < assert_na_end) in check_opcode_types()
1184 cc += 1 + 2 + cc[1]; in check_opcode_types()
1190 cc += 1; in check_opcode_types()
1194 if (cc < assert_back_end) in check_opcode_types()
1196 if (cc < assert_na_end) in check_opcode_types()
1198 cc += 1; in check_opcode_types()
1204 if (cc < assert_back_end) in check_opcode_types()
1206 if (cc < assert_na_end) in check_opcode_types()
1208 cc += 1 + 2 + cc[1]; in check_opcode_types()
1214 if (cc < assert_na_end) in check_opcode_types()
1216 cc++; in check_opcode_types()
1220 cc = next_opcode(common, cc); in check_opcode_types()
1221 if (cc == NULL) in check_opcode_types()
1239 static int detect_early_fail(compiler_common *common, PCRE2_SPTR cc, int *private_data_start, sljit… in detect_early_fail() argument
1248 SLJIT_ASSERT(*cc == OP_ONCE || *cc == OP_BRA || *cc == OP_CBRA); in detect_early_fail()
1249 SLJIT_ASSERT(*cc != OP_CBRA || common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] != 0); in detect_early_fail()
1252 next_alt = cc + GET(cc, 1); in detect_early_fail()
1259 cc += 1 + LINK_SIZE + ((*cc == OP_CBRA) ? IMM2_SIZE : 0); in detect_early_fail()
1265 switch(*cc) in detect_early_fail()
1279 cc++; in detect_early_fail()
1296 cc++; in detect_early_fail()
1304 cc++; in detect_early_fail()
1310 cc += 1 + 2; in detect_early_fail()
1318 cc += 2; in detect_early_fail()
1320 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1331 cc += 1; in detect_early_fail()
1333 if (cc[0] != OP_ANYNL && cc[0] != OP_EXTUNI) in detect_early_fail()
1335 accelerated_start = cc - 1; in detect_early_fail()
1348 cc += IMM2_SIZE; in detect_early_fail()
1358 cc += 1; in detect_early_fail()
1388 accelerated_start = cc; in detect_early_fail()
1389 cc += 2; in detect_early_fail()
1391 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1411 cc += IMM2_SIZE; in detect_early_fail()
1429 cc += 2; in detect_early_fail()
1431 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in detect_early_fail()
1439 accelerated_start = cc; in detect_early_fail()
1440 cc += ((*cc == OP_XCLASS) ? GET(cc, 1) : (unsigned int)(1 + (32 / sizeof(PCRE2_UCHAR)))); in detect_early_fail()
1442 accelerated_start = cc; in detect_early_fail()
1443 cc += (1 + (32 / sizeof(PCRE2_UCHAR))); in detect_early_fail()
1446 switch (*cc) in detect_early_fail()
1454 cc++; in detect_early_fail()
1460 cc += 2 * IMM2_SIZE; in detect_early_fail()
1465 cc++; in detect_early_fail()
1479 end = cc + GET(cc, 1); in detect_early_fail()
1483 if (*cc == OP_CBRA) in detect_early_fail()
1485 if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in detect_early_fail()
1487 cc += IMM2_SIZE; in detect_early_fail()
1490 cc += 1 + LINK_SIZE; in detect_early_fail()
1498 end = bracketend(cc) - (1 + LINK_SIZE); in detect_early_fail()
1502 if (*cc == OP_CBRA && common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in detect_early_fail()
1505 count = detect_early_fail(common, cc, private_data_start, depth + 1, count); in detect_early_fail()
1508 cc = end + (1 + LINK_SIZE); in detect_early_fail()
1514 SLJIT_ASSERT(PRIVATE_DATA(cc) == 0); in detect_early_fail()
1515 if (cc >= next_alt) in detect_early_fail()
1517 cc += 1 + LINK_SIZE; in detect_early_fail()
1570 if (*cc != OP_ALT && *cc != OP_KET) in detect_early_fail()
1575 cc = next_alt; in detect_early_fail()
1576 next_alt = cc + GET(cc, 1); in detect_early_fail()
1578 while (*cc == OP_ALT); in detect_early_fail()
1583 static int get_class_iterator_size(PCRE2_SPTR cc) in get_class_iterator_size() argument
1587 switch(*cc) in get_class_iterator_size()
1601 min = GET2(cc, 1); in get_class_iterator_size()
1602 max = GET2(cc, 1 + IMM2_SIZE); in get_class_iterator_size()
1604 return (*cc == OP_CRRANGE) ? 2 : 1; in get_class_iterator_size()
1754 PCRE2_SPTR cc = common->start; in set_private_data_ptrs() local
1761 while (cc < ccend) in set_private_data_ptrs()
1769 if (repeat_check && (*cc == OP_ONCE || *cc == OP_BRA || *cc == OP_CBRA || *cc == OP_COND)) in set_private_data_ptrs()
1771 if (detect_repeat(common, cc)) in set_private_data_ptrs()
1775 if (cc >= end) in set_private_data_ptrs()
1776 end = bracketend(cc); in set_private_data_ptrs()
1781 switch(*cc) in set_private_data_ptrs()
1784 if (common->private_data_ptrs[cc + 1 - common->start] != 0) in set_private_data_ptrs()
1786 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1788 cc += common->private_data_ptrs[cc + 1 - common->start]; in set_private_data_ptrs()
1790 cc += 1 + LINK_SIZE; in set_private_data_ptrs()
1805 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1812 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1819 alternative = cc + GET(cc, 1); in set_private_data_ptrs()
1822 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1866 if (cc[1] != OP_ANYNL && cc[1] != OP_EXTUNI) in set_private_data_ptrs()
1872 if (cc[1 + IMM2_SIZE] != OP_ANYNL && cc[1 + IMM2_SIZE] != OP_EXTUNI) in set_private_data_ptrs()
1884 space = get_class_iterator_size(cc + size); in set_private_data_ptrs()
1889 size = GET(cc, 1); in set_private_data_ptrs()
1890 space = get_class_iterator_size(cc + size); in set_private_data_ptrs()
1895 cc = next_opcode(common, cc); in set_private_data_ptrs()
1896 SLJIT_ASSERT(cc != NULL); in set_private_data_ptrs()
1902 if (space > 0 && cc >= end) in set_private_data_ptrs()
1904 common->private_data_ptrs[cc - common->start] = private_data_ptr; in set_private_data_ptrs()
1912 cc += -size; in set_private_data_ptrs()
1914 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in set_private_data_ptrs()
1918 cc += size; in set_private_data_ptrs()
1923 if (cc >= end) in set_private_data_ptrs()
1925 end = bracketend(cc); in set_private_data_ptrs()
1929 cc += bracketlen; in set_private_data_ptrs()
1936 static int get_framesize(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, BOOL recursive, … in get_framesize() argument
1955 ccend = bracketend(cc) - (1 + LINK_SIZE); in get_framesize()
1956 if (!recursive && (*cc == OP_CBRAPOS || *cc == OP_SCBRAPOS)) in get_framesize()
1962 cc = next_opcode(common, cc); in get_framesize()
1965 SLJIT_ASSERT(cc != NULL); in get_framesize()
1966 while (cc < ccend) in get_framesize()
1967 switch(*cc) in get_framesize()
1977 cc += 1; in get_framesize()
1993 cc += 1 + 2 + cc[1]; in get_framesize()
2013 cc += 1 + LINK_SIZE; in get_framesize()
2027 cc += 1 + LINK_SIZE + IMM2_SIZE; in get_framesize()
2034 cc ++; in get_framesize()
2108 cc = next_opcode(common, cc); in get_framesize()
2109 SLJIT_ASSERT(cc != NULL); in get_framesize()
2122 static void init_frame(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, int stackpos, int … in init_frame() argument
2138 ccend = bracketend(cc) - (1 + LINK_SIZE); in init_frame()
2139 if (*cc != OP_CBRAPOS && *cc != OP_SCBRAPOS) in init_frame()
2140 cc = next_opcode(common, cc); in init_frame()
2143 SLJIT_ASSERT(cc != NULL); in init_frame()
2144 while (cc < ccend) in init_frame()
2145 switch(*cc) in init_frame()
2158 cc += 1; in init_frame()
2175 cc += 1 + 2 + cc[1]; in init_frame()
2206 cc += 1 + LINK_SIZE; in init_frame()
2222 offset = (GET2(cc, 1 + LINK_SIZE)) << 1; in init_frame()
2232 cc += 1 + LINK_SIZE + IMM2_SIZE; in init_frame()
2236 cc = next_opcode(common, cc); in init_frame()
2237 SLJIT_ASSERT(cc != NULL); in init_frame()
2322 static int get_recurse_data_length(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, in get_recurse_data_length() argument
2341 while (cc < ccend) in get_recurse_data_length()
2344 switch(*cc) in get_recurse_data_length()
2349 cc += 1; in get_recurse_data_length()
2359 cc += 1 + LINK_SIZE; in get_recurse_data_length()
2363 if (PRIVATE_DATA(cc) != 0) in get_recurse_data_length()
2366 SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0); in get_recurse_data_length()
2367 cc += PRIVATE_DATA(cc + 1); in get_recurse_data_length()
2369 cc += 1 + LINK_SIZE; in get_recurse_data_length()
2385 SLJIT_ASSERT(PRIVATE_DATA(cc) != 0); in get_recurse_data_length()
2386 cc += 1 + LINK_SIZE; in get_recurse_data_length()
2394 if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in get_recurse_data_length()
2396 cc += 1 + LINK_SIZE + IMM2_SIZE; in get_recurse_data_length()
2404 cc += 1 + LINK_SIZE + IMM2_SIZE; in get_recurse_data_length()
2409 alternative = cc + GET(cc, 1); in get_recurse_data_length()
2412 cc += 1 + LINK_SIZE; in get_recurse_data_length()
2416 if (PRIVATE_DATA(cc) != 0) in get_recurse_data_length()
2418 cc += 2; in get_recurse_data_length()
2420 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2425 if (PRIVATE_DATA(cc) != 0) in get_recurse_data_length()
2427 cc += 2; in get_recurse_data_length()
2429 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2434 if (PRIVATE_DATA(cc) != 0) in get_recurse_data_length()
2436 cc += 2 + IMM2_SIZE; in get_recurse_data_length()
2438 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in get_recurse_data_length()
2443 if (PRIVATE_DATA(cc) != 0) in get_recurse_data_length()
2445 cc += 1; in get_recurse_data_length()
2449 if (PRIVATE_DATA(cc) != 0) in get_recurse_data_length()
2451 cc += 1; in get_recurse_data_length()
2455 if (PRIVATE_DATA(cc) != 0) in get_recurse_data_length()
2457 cc += 1 + IMM2_SIZE; in get_recurse_data_length()
2464 size = (*cc == OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR); in get_recurse_data_length()
2468 if (PRIVATE_DATA(cc) != 0) in get_recurse_data_length()
2469 length += get_class_iterator_size(cc + size); in get_recurse_data_length()
2470 cc += size; in get_recurse_data_length()
2482 if (*cc != OP_MARK) in get_recurse_data_length()
2485 cc += 1 + 2 + cc[1]; in get_recurse_data_length()
2492 cc++; in get_recurse_data_length()
2497 cc += 1 + 2 + cc[1]; in get_recurse_data_length()
2505 cc++; in get_recurse_data_length()
2511 cc++; in get_recurse_data_length()
2515 cc = next_opcode(common, cc); in get_recurse_data_length()
2516 SLJIT_ASSERT(cc != NULL); in get_recurse_data_length()
2520 SLJIT_ASSERT(cc == ccend); in get_recurse_data_length()
2548 static void copy_recurse_data(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, in copy_recurse_data() argument
2643 while (cc < ccend) in copy_recurse_data()
2649 switch(*cc) in copy_recurse_data()
2659 cc += 1; in copy_recurse_data()
2684 cc += 1 + LINK_SIZE; in copy_recurse_data()
2688 if (PRIVATE_DATA(cc) != 0) in copy_recurse_data()
2691 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2692 SLJIT_ASSERT(PRIVATE_DATA(cc + 1) != 0); in copy_recurse_data()
2693 cc += PRIVATE_DATA(cc + 1); in copy_recurse_data()
2695 cc += 1 + LINK_SIZE; in copy_recurse_data()
2711 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2712 cc += 1 + LINK_SIZE; in copy_recurse_data()
2717 offset = (GET2(cc, 1 + LINK_SIZE)) << 1; in copy_recurse_data()
2729 if (common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0) in copy_recurse_data()
2732 private_srcw[0] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE)); in copy_recurse_data()
2734 cc += 1 + LINK_SIZE + IMM2_SIZE; in copy_recurse_data()
2739 offset = (GET2(cc, 1 + LINK_SIZE)) << 1; in copy_recurse_data()
2752 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2753 private_srcw[1] = OVECTOR_PRIV(GET2(cc, 1 + LINK_SIZE)); in copy_recurse_data()
2754 cc += 1 + LINK_SIZE + IMM2_SIZE; in copy_recurse_data()
2759 alternative = cc + GET(cc, 1); in copy_recurse_data()
2763 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2765 cc += 1 + LINK_SIZE; in copy_recurse_data()
2769 if (PRIVATE_DATA(cc)) in copy_recurse_data()
2772 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2774 cc += 2; in copy_recurse_data()
2776 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2781 if (PRIVATE_DATA(cc)) in copy_recurse_data()
2784 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2785 private_srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw); in copy_recurse_data()
2787 cc += 2; in copy_recurse_data()
2789 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2794 if (PRIVATE_DATA(cc)) in copy_recurse_data()
2797 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2798 private_srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_sw); in copy_recurse_data()
2800 cc += 2 + IMM2_SIZE; in copy_recurse_data()
2802 if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]); in copy_recurse_data()
2807 if (PRIVATE_DATA(cc)) in copy_recurse_data()
2810 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2812 cc += 1; in copy_recurse_data()
2816 if (PRIVATE_DATA(cc)) in copy_recurse_data()
2819 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2822 cc += 1; in copy_recurse_data()
2826 if (PRIVATE_DATA(cc)) in copy_recurse_data()
2829 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2832 cc += 1 + IMM2_SIZE; in copy_recurse_data()
2839 i = (*cc == OP_XCLASS) ? GET(cc, 1) : 1 + 32 / (int)sizeof(PCRE2_UCHAR); in copy_recurse_data()
2843 if (PRIVATE_DATA(cc) != 0) in copy_recurse_data()
2844 switch(get_class_iterator_size(cc + i)) in copy_recurse_data()
2848 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2853 private_srcw[0] = PRIVATE_DATA(cc); in copy_recurse_data()
2861 cc += i; in copy_recurse_data()
2881 cc += 1 + 2 + cc[1]; in copy_recurse_data()
2892 cc++; in copy_recurse_data()
2896 cc = next_opcode(common, cc); in copy_recurse_data()
2897 SLJIT_ASSERT(cc != NULL); in copy_recurse_data()
2962 SLJIT_ASSERT(cc == ccend && stackptr == stacktop); in copy_recurse_data()
2967 static SLJIT_INLINE PCRE2_SPTR set_then_offsets(compiler_common *common, PCRE2_SPTR cc, sljit_u8 *c… in set_then_offsets() argument
2969 PCRE2_SPTR end = bracketend(cc); in set_then_offsets()
2970 BOOL has_alternatives = cc[GET(cc, 1)] == OP_ALT; in set_then_offsets()
2973 if (*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NA) in set_then_offsets()
2976 if (*cc == OP_COND || *cc == OP_SCOND) in set_then_offsets()
2979 cc = next_opcode(common, cc); in set_then_offsets()
2981 current_offset = common->then_offsets + (cc - common->start); in set_then_offsets()
2983 while (cc < end) in set_then_offsets()
2985 if ((*cc >= OP_ASSERT && *cc <= OP_ASSERTBACK_NA) || (*cc >= OP_ONCE && *cc <= OP_SCOND)) in set_then_offsets()
2986 cc = set_then_offsets(common, cc, current_offset); in set_then_offsets()
2989 if (*cc == OP_ALT && has_alternatives) in set_then_offsets()
2990 current_offset = common->then_offsets + (cc + 1 + LINK_SIZE - common->start); in set_then_offsets()
2991 if (*cc >= OP_THEN && *cc <= OP_THEN_ARG && current_offset != NULL) in set_then_offsets()
2993 cc = next_opcode(common, cc); in set_then_offsets()
3442 static SLJIT_INLINE BOOL char_has_othercase(compiler_common *common, PCRE2_SPTR cc) in char_has_othercase() argument
3452 GETCHAR(c, cc); in char_has_othercase()
3455 c = *cc; in char_has_othercase()
3464 c = *cc; in char_has_othercase()
3478 static unsigned int char_get_othercase_bit(compiler_common *common, PCRE2_SPTR cc) in char_get_othercase_bit() argument
3491 GETCHAR(c, cc); in char_get_othercase_bit()
3494 c = *cc; in char_get_othercase_bit()
3503 c = *cc; in char_get_othercase_bit()
3507 c = *cc; in char_get_othercase_bit()
3527 n = GET_EXTRALEN(*cc); in char_get_othercase_bit()
5362 static int scan_prefix(compiler_common *common, PCRE2_SPTR cc, fast_forward_char_data *chars, int m… in scan_prefix() argument
5390 switch (*cc) in scan_prefix()
5397 cc++; in scan_prefix()
5412 cc++; in scan_prefix()
5421 cc = bracketend(cc); in scan_prefix()
5432 cc++; in scan_prefix()
5439 repeat = GET2(cc, 1); in scan_prefix()
5441 cc += 1 + IMM2_SIZE; in scan_prefix()
5453 cc++; in scan_prefix()
5455 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
5457 max_chars = scan_prefix(common, cc + len, chars, max_chars, rec_count); in scan_prefix()
5464 cc += 1 + LINK_SIZE; in scan_prefix()
5468 cc += GET(cc, 1); in scan_prefix()
5476 alternative = cc + GET(cc, 1); in scan_prefix()
5485 if (*cc == OP_CBRA || *cc == OP_CBRAPOS) in scan_prefix()
5486 cc += IMM2_SIZE; in scan_prefix()
5487 cc += 1 + LINK_SIZE; in scan_prefix()
5492 if (common->utf && !is_char7_bitset((const sljit_u8 *)(cc + 1), FALSE)) in scan_prefix()
5511 cc += GET(cc, 1); in scan_prefix()
5521 cc++; in scan_prefix()
5530 cc++; in scan_prefix()
5539 cc++; in scan_prefix()
5544 cc++; in scan_prefix()
5555 cc++; in scan_prefix()
5565 cc += 1 + 2; in scan_prefix()
5570 repeat = GET2(cc, 1); in scan_prefix()
5571 cc += 1 + IMM2_SIZE; in scan_prefix()
5580 repeat = GET2(cc, 1); in scan_prefix()
5581 cc += 1 + IMM2_SIZE + 1; in scan_prefix()
5607 bytes = (sljit_u8*) (cc + 1); in scan_prefix()
5608 cc += 1 + 32 / sizeof(PCRE2_UCHAR); in scan_prefix()
5610 switch (*cc) in scan_prefix()
5618 max_chars = scan_prefix(common, cc + 1, chars, max_chars, rec_count); in scan_prefix()
5632 repeat = GET2(cc, 1); in scan_prefix()
5676 switch (*cc) in scan_prefix()
5686 cc++; in scan_prefix()
5692 if (GET2(cc, 1) != GET2(cc, 1 + IMM2_SIZE)) in scan_prefix()
5694 cc += 1 + 2 * IMM2_SIZE; in scan_prefix()
5704 if (common->utf && HAS_EXTRALEN(*cc)) len += GET_EXTRALEN(*cc); in scan_prefix()
5707 if (caseless && char_has_othercase(common, cc)) in scan_prefix()
5712 GETCHAR(chr, cc); in scan_prefix()
5719 chr = *cc; in scan_prefix()
5735 cc_save = cc; in scan_prefix()
5744 chr = *cc; in scan_prefix()
5745 add_prefix_char(*cc, chars, len == 0); in scan_prefix()
5753 cc++; in scan_prefix()
5762 cc = cc_save; in scan_prefix()
7161 static PCRE2_SPTR byte_sequence_compare(compiler_common *common, BOOL caseless, PCRE2_SPTR cc, in byte_sequence_compare() argument
7171 if (caseless && char_has_othercase(common, cc)) in byte_sequence_compare()
7173 othercasebit = char_get_othercase_bit(common, cc); in byte_sequence_compare()
7177 othercasechar = cc + (othercasebit >> 8); in byte_sequence_compare()
7184 othercasechar = cc + (othercasebit >> 9); in byte_sequence_compare()
7218 if (common->utf && HAS_EXTRALEN(*cc)) in byte_sequence_compare()
7219 utflength += GET_EXTRALEN(*cc); in byte_sequence_compare()
7229 if (othercasebit != 0 && othercasechar == cc) in byte_sequence_compare()
7231 context->c.asuchars[context->ucharptr] = *cc | othercasebit; in byte_sequence_compare()
7236 context->c.asuchars[context->ucharptr] = *cc; in byte_sequence_compare()
7294 if (othercasebit != 0 && othercasechar == cc) in byte_sequence_compare()
7297 …add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, context->sourcereg, 0, SLJIT_IMM, *cc | otherc… in byte_sequence_compare()
7300 add_jump(compiler, backtracks, CMP(SLJIT_NOT_EQUAL, context->sourcereg, 0, SLJIT_IMM, *cc)); in byte_sequence_compare()
7304 cc++; in byte_sequence_compare()
7311 return cc; in byte_sequence_compare()
7336 …e_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtra…
7338 static void compile_xclass_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtra… in compile_xclass_matchingpath() argument
7342 jump_list **list = (cc[0] & XCL_NOT) == 0 ? &found : backtracks; in compile_xclass_matchingpath()
7360 cc++; in compile_xclass_matchingpath()
7361 ccbegin = cc; in compile_xclass_matchingpath()
7364 if (cc[-1] & XCL_MAP) in compile_xclass_matchingpath()
7367 cc += 32 / sizeof(PCRE2_UCHAR); in compile_xclass_matchingpath()
7370 while (*cc != XCL_END) in compile_xclass_matchingpath()
7373 if (*cc == XCL_SINGLE) in compile_xclass_matchingpath()
7375 cc ++; in compile_xclass_matchingpath()
7376 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7383 else if (*cc == XCL_RANGE) in compile_xclass_matchingpath()
7385 cc ++; in compile_xclass_matchingpath()
7386 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7388 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7397 SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); in compile_xclass_matchingpath()
7398 cc++; in compile_xclass_matchingpath()
7399 if (*cc == PT_CLIST) in compile_xclass_matchingpath()
7401 other_cases = PRIV(ucd_caseless_sets) + cc[1]; in compile_xclass_matchingpath()
7415 switch(*cc) in compile_xclass_matchingpath()
7419 if (cc[-1] == XCL_PROP) in compile_xclass_matchingpath()
7421 compile_char1_matchingpath(common, OP_ALLANY, cc, backtracks, FALSE); in compile_xclass_matchingpath()
7458 cc += 2; in compile_xclass_matchingpath()
7465 cc = ccbegin; in compile_xclass_matchingpath()
7466 if ((cc[-1] & XCL_NOT) != 0) in compile_xclass_matchingpath()
7477 if ((cc[-1] & XCL_HASPROP) == 0) in compile_xclass_matchingpath()
7479 if ((cc[-1] & XCL_MAP) != 0) in compile_xclass_matchingpath()
7482 …if (!optimize_class(common, (const sljit_u8 *)cc, (((const sljit_u8 *)cc)[31] & 0x80) != 0, TRUE, … in compile_xclass_matchingpath()
7486 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); in compile_xclass_matchingpath()
7495 cc += 32 / sizeof(PCRE2_UCHAR); in compile_xclass_matchingpath()
7500 …add_jump(compiler, (cc[-1] & XCL_NOT) == 0 ? backtracks : &found, CMP(SLJIT_GREATER, TMP2, 0, SLJI… in compile_xclass_matchingpath()
7503 else if ((cc[-1] & XCL_MAP) != 0) in compile_xclass_matchingpath()
7509 if (!optimize_class(common, (const sljit_u8 *)cc, FALSE, TRUE, list)) in compile_xclass_matchingpath()
7519 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); in compile_xclass_matchingpath()
7531 cc += 32 / sizeof(PCRE2_UCHAR); in compile_xclass_matchingpath()
7567 ccbegin = cc; in compile_xclass_matchingpath()
7569 while (*cc != XCL_END) in compile_xclass_matchingpath()
7571 if (*cc == XCL_SINGLE) in compile_xclass_matchingpath()
7573 cc ++; in compile_xclass_matchingpath()
7574 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7576 else if (*cc == XCL_RANGE) in compile_xclass_matchingpath()
7578 cc ++; in compile_xclass_matchingpath()
7579 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7580 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7584 SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); in compile_xclass_matchingpath()
7585 cc++; in compile_xclass_matchingpath()
7586 if (*cc == PT_SC) in compile_xclass_matchingpath()
7590 if (cc[-1] == XCL_NOTPROP) in compile_xclass_matchingpath()
7592 jump = CMP(SLJIT_EQUAL ^ invertcmp, TMP1, 0, SLJIT_IMM, (int)cc[1]); in compile_xclass_matchingpath()
7595 cc += 2; in compile_xclass_matchingpath()
7599 cc = ccbegin; in compile_xclass_matchingpath()
7656 while (*cc != XCL_END) in compile_xclass_matchingpath()
7662 if (*cc == XCL_SINGLE) in compile_xclass_matchingpath()
7664 cc ++; in compile_xclass_matchingpath()
7665 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7667 if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE)) in compile_xclass_matchingpath()
7686 else if (*cc == XCL_RANGE) in compile_xclass_matchingpath()
7688 cc ++; in compile_xclass_matchingpath()
7689 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7691 GETCHARINCTEST(c, cc); in compile_xclass_matchingpath()
7693 if (numberofcmps < 3 && (*cc == XCL_SINGLE || *cc == XCL_RANGE)) in compile_xclass_matchingpath()
7715 SLJIT_ASSERT(*cc == XCL_PROP || *cc == XCL_NOTPROP); in compile_xclass_matchingpath()
7716 if (*cc == XCL_NOTPROP) in compile_xclass_matchingpath()
7718 cc++; in compile_xclass_matchingpath()
7719 switch(*cc) in compile_xclass_matchingpath()
7737 c = PRIV(ucp_typerange)[(int)cc[1] * 2]; in compile_xclass_matchingpath()
7739 …jump = CMP(SLJIT_LESS_EQUAL ^ invertcmp, typereg, 0, SLJIT_IMM, PRIV(ucp_typerange)[(int)cc[1] * 2… in compile_xclass_matchingpath()
7743 jump = CMP(SLJIT_EQUAL ^ invertcmp, typereg, 0, SLJIT_IMM, (int)cc[1] - typeoffset); in compile_xclass_matchingpath()
7777 OP_FLAGS((*cc == PT_ALNUM) ? SLJIT_MOV : SLJIT_OR, TMP2, 0, SLJIT_LESS_EQUAL); in compile_xclass_matchingpath()
7785 other_cases = PRIV(ucd_caseless_sets) + cc[1]; in compile_xclass_matchingpath()
7919 cc += 2; in compile_xclass_matchingpath()
7936 …sertion_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtra… in compile_simple_assertion_matchingpath() argument
7956 return cc; in compile_simple_assertion_matchingpath()
7967 return cc; in compile_simple_assertion_matchingpath()
7976 return cc; in compile_simple_assertion_matchingpath()
7981 return cc; in compile_simple_assertion_matchingpath()
8051 return cc; in compile_simple_assertion_matchingpath()
8057 return cc; in compile_simple_assertion_matchingpath()
8070 compile_simple_assertion_matchingpath(common, OP_EODN, cc, backtracks); in compile_simple_assertion_matchingpath()
8076 return cc; in compile_simple_assertion_matchingpath()
8118 return cc; in compile_simple_assertion_matchingpath()
8136 return cc; in compile_simple_assertion_matchingpath()
8175 return cc; in compile_simple_assertion_matchingpath()
8178 length = GET(cc, 0); in compile_simple_assertion_matchingpath()
8180 return cc + LINK_SIZE; in compile_simple_assertion_matchingpath()
8205 return cc + LINK_SIZE; in compile_simple_assertion_matchingpath()
8208 return cc; in compile_simple_assertion_matchingpath()
8215 static PCRE2_SPTR SLJIT_FUNC do_extuni_utf(jit_arguments *args, PCRE2_SPTR cc) in do_extuni_utf() argument
8224 prevcc = cc; in do_extuni_utf()
8228 GETCHARINC(c, cc); in do_extuni_utf()
8234 endcc = cc; in do_extuni_utf()
8274 endcc = cc; in do_extuni_utf()
8276 while (cc < end_subject); in do_extuni_utf()
8283 static PCRE2_SPTR SLJIT_FUNC do_extuni_utf_invalid(jit_arguments *args, PCRE2_SPTR cc) in do_extuni_utf_invalid() argument
8292 prevcc = cc; in do_extuni_utf_invalid()
8296 GETCHARINC_INVALID(c, cc, end_subject, break); in do_extuni_utf_invalid()
8302 endcc = cc; in do_extuni_utf_invalid()
8341 endcc = cc; in do_extuni_utf_invalid()
8343 while (cc < end_subject); in do_extuni_utf_invalid()
8348 static PCRE2_SPTR SLJIT_FUNC do_extuni_no_utf(jit_arguments *args, PCRE2_SPTR cc) in do_extuni_no_utf() argument
8358 c = *cc++; in do_extuni_no_utf()
8366 while (cc < end_subject) in do_extuni_no_utf()
8368 c = *cc; in do_extuni_no_utf()
8384 bptr = cc - 1; in do_extuni_no_utf()
8412 cc++; in do_extuni_no_utf()
8415 return cc; in do_extuni_no_utf()
8420 …e_char1_matchingpath(compiler_common *common, PCRE2_UCHAR type, PCRE2_SPTR cc, jump_list **backtra… in compile_char1_matchingpath() argument
8448 return cc; in compile_char1_matchingpath()
8462 return cc; in compile_char1_matchingpath()
8476 return cc; in compile_char1_matchingpath()
8498 return cc; in compile_char1_matchingpath()
8509 return cc; in compile_char1_matchingpath()
8528 return cc; in compile_char1_matchingpath()
8533 return cc; in compile_char1_matchingpath()
8539 return cc; in compile_char1_matchingpath()
8546 propdata[2] = cc[0]; in compile_char1_matchingpath()
8547 propdata[3] = cc[1]; in compile_char1_matchingpath()
8552 return cc + 2; in compile_char1_matchingpath()
8575 return cc; in compile_char1_matchingpath()
8590 return cc; in compile_char1_matchingpath()
8605 return cc; in compile_char1_matchingpath()
8636 return cc; in compile_char1_matchingpath()
8643 if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc); in compile_char1_matchingpath()
8649 if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0) in compile_char1_matchingpath()
8660 return byte_sequence_compare(common, type == OP_CHARI, cc, &context, backtracks); in compile_char1_matchingpath()
8666 GETCHAR(c, cc); in compile_char1_matchingpath()
8670 c = *cc; in compile_char1_matchingpath()
8672 SLJIT_ASSERT(type == OP_CHARI && char_has_othercase(common, cc)); in compile_char1_matchingpath()
8694 return cc + length; in compile_char1_matchingpath()
8706 c = *cc; in compile_char1_matchingpath()
8710 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
8724 return cc + 1; in compile_char1_matchingpath()
8729 GETCHARLEN(c, cc, length); in compile_char1_matchingpath()
8734 c = *cc; in compile_char1_matchingpath()
8736 if (type == OP_NOT || !char_has_othercase(common, cc)) in compile_char1_matchingpath()
8757 return cc + length; in compile_char1_matchingpath()
8765 bit = (common->utf && is_char7_bitset((const sljit_u8 *)cc, type == OP_NCLASS)) ? 127 : 255; in compile_char1_matchingpath()
8777 if (optimize_class(common, (const sljit_u8 *)cc, type == OP_NCLASS, FALSE, backtracks)) in compile_char1_matchingpath()
8778 return cc + 32 / sizeof(PCRE2_UCHAR); in compile_char1_matchingpath()
8802 OP1(SLJIT_MOV_U8, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_sw)cc); in compile_char1_matchingpath()
8811 return cc + 32 / sizeof(PCRE2_UCHAR); in compile_char1_matchingpath()
8817 compile_xclass_matchingpath(common, cc + LINK_SIZE, backtracks); in compile_char1_matchingpath()
8818 return cc + GET(cc, 0) - 1; in compile_char1_matchingpath()
8822 return cc; in compile_char1_matchingpath()
8825 static SLJIT_INLINE PCRE2_SPTR compile_charn_matchingpath(compiler_common *common, PCRE2_SPTR cc, P… in compile_charn_matchingpath() argument
8830 PCRE2_SPTR ccbegin = cc; in compile_charn_matchingpath()
8837 if (cc >= ccend) in compile_charn_matchingpath()
8840 if (*cc == OP_CHAR) in compile_charn_matchingpath()
8844 if (common->utf && HAS_EXTRALEN(cc[1])) in compile_charn_matchingpath()
8845 size += GET_EXTRALEN(cc[1]); in compile_charn_matchingpath()
8848 else if (*cc == OP_CHARI) in compile_charn_matchingpath()
8854 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
8856 else if (HAS_EXTRALEN(cc[1])) in compile_charn_matchingpath()
8857 size += GET_EXTRALEN(cc[1]); in compile_charn_matchingpath()
8861 if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0) in compile_charn_matchingpath()
8867 cc += 1 + size; in compile_charn_matchingpath()
8872 cc = ccbegin; in compile_charn_matchingpath()
8883 …do cc = byte_sequence_compare(common, *cc == OP_CHARI, cc + 1, &context, backtracks); while (conte… in compile_charn_matchingpath()
8884 return cc; in compile_charn_matchingpath()
8888 return compile_char1_matchingpath(common, *cc, cc + 1, backtracks, TRUE); in compile_charn_matchingpath()
8903 backtrack->cc = (ccstart); \
8916 backtrack->cc = (ccstart); \
8923 static void compile_dnref_search(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks) in compile_dnref_search() argument
8927 int count = GET2(cc, 1 + IMM2_SIZE); in compile_dnref_search()
8928 PCRE2_SPTR slot = common->name_table + GET2(cc, 1) * common->name_entry_size; in compile_dnref_search()
8932 SLJIT_ASSERT(*cc == OP_DNREF || *cc == OP_DNREFI); in compile_dnref_search()
8953 static void compile_ref_matchingpath(compiler_common *common, PCRE2_SPTR cc, jump_list **backtracks… in compile_ref_matchingpath() argument
8956 BOOL ref = (*cc == OP_REF || *cc == OP_REFI); in compile_ref_matchingpath()
8972 offset = GET2(cc, 1) << 1; in compile_ref_matchingpath()
8982 if (common->utf && *cc == OP_REFI) in compile_ref_matchingpath()
9088 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
9100 …add_jump(compiler, *cc == OP_REF ? &common->casefulcmp : &common->caselesscmp, JUMP(SLJIT_FAST_CAL… in compile_ref_matchingpath()
9118 …SPTR compile_ref_iterator_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_common *p… in compile_ref_iterator_matchingpath() argument
9121 BOOL ref = (*cc == OP_REF || *cc == OP_REFI); in compile_ref_iterator_matchingpath()
9128 PCRE2_SPTR ccbegin = cc; in compile_ref_iterator_matchingpath()
9132 PUSH_BACKTRACK(sizeof(ref_iterator_backtrack), cc, NULL); in compile_ref_iterator_matchingpath()
9135 offset = GET2(cc, 1) << 1; in compile_ref_iterator_matchingpath()
9137 cc += IMM2_SIZE; in compile_ref_iterator_matchingpath()
9138 type = cc[1 + IMM2_SIZE]; in compile_ref_iterator_matchingpath()
9148 cc += 1 + IMM2_SIZE + 1; in compile_ref_iterator_matchingpath()
9154 cc += 1 + IMM2_SIZE + 1; in compile_ref_iterator_matchingpath()
9160 cc += 1 + IMM2_SIZE + 1; in compile_ref_iterator_matchingpath()
9164 min = GET2(cc, 1 + IMM2_SIZE + 1); in compile_ref_iterator_matchingpath()
9165 max = GET2(cc, 1 + IMM2_SIZE + 1 + IMM2_SIZE); in compile_ref_iterator_matchingpath()
9166 cc += 1 + IMM2_SIZE + 1 + 2 * IMM2_SIZE; in compile_ref_iterator_matchingpath()
9255 return cc; in compile_ref_iterator_matchingpath()
9322 return cc; in compile_ref_iterator_matchingpath()
9325 static SLJIT_INLINE PCRE2_SPTR compile_recurse_matchingpath(compiler_common *common, PCRE2_SPTR cc,… in compile_recurse_matchingpath() argument
9331 sljit_sw start = GET(cc, 1); in compile_recurse_matchingpath()
9335 PUSH_BACKTRACK(sizeof(recurse_backtrack), cc, NULL); in compile_recurse_matchingpath()
9343 return cc + 1 + LINK_SIZE; in compile_recurse_matchingpath()
9381 return cc + 1 + LINK_SIZE; in compile_recurse_matchingpath()
9441 static SLJIT_INLINE PCRE2_SPTR compile_callout_matchingpath(compiler_common *common, PCRE2_SPTR cc,… in compile_callout_matchingpath() argument
9446 unsigned int callout_length = (*cc == OP_CALLOUT) in compile_callout_matchingpath()
9447 ? PRIV(OP_lengths)[OP_CALLOUT] : GET(cc, 1 + 2 * LINK_SIZE); in compile_callout_matchingpath()
9453 PUSH_BACKTRACK(sizeof(backtrack_common), cc, NULL); in compile_callout_matchingpath()
9462 value1 = (*cc == OP_CALLOUT) ? cc[1 + 2 * LINK_SIZE] : 0; in compile_callout_matchingpath()
9473 OP1(mov_opcode, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(pattern_position), SLJIT_IMM, GET(cc, 1)); in compile_callout_matchingpath()
9474 OP1(mov_opcode, SLJIT_MEM1(STACK_TOP), CALLOUT_ARG_OFFSET(next_item_length), SLJIT_IMM, GET(cc, 1 +… in compile_callout_matchingpath()
9476 if (*cc == OP_CALLOUT) in compile_callout_matchingpath()
9484 value1 = (sljit_sw) (cc + (1 + 4*LINK_SIZE) + 1); in compile_callout_matchingpath()
9486 value3 = (sljit_sw) (GET(cc, 1 + 3*LINK_SIZE)); in compile_callout_matchingpath()
9512 return cc + callout_length; in compile_callout_matchingpath()
9518 static SLJIT_INLINE BOOL assert_needs_str_ptr_saving(PCRE2_SPTR cc) in assert_needs_str_ptr_saving() argument
9522 switch (*cc) in assert_needs_str_ptr_saving()
9525 cc += GET(cc, 1 + 2*LINK_SIZE); in assert_needs_str_ptr_saving()
9536 cc += PRIV(OP_lengths)[*cc]; in assert_needs_str_ptr_saving()
9548 static PCRE2_SPTR compile_assert_matchingpath(compiler_common *common, PCRE2_SPTR cc, assert_backtr… in compile_assert_matchingpath() argument
9578 if (*cc == OP_BRAZERO || *cc == OP_BRAMINZERO) in compile_assert_matchingpath()
9581 bra = *cc; in compile_assert_matchingpath()
9582 cc++; in compile_assert_matchingpath()
9584 private_data_ptr = PRIVATE_DATA(cc); in compile_assert_matchingpath()
9586 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_assert_matchingpath()
9589 opcode = *cc; in compile_assert_matchingpath()
9592 ccbegin = cc; in compile_assert_matchingpath()
9593 cc += GET(cc, 1); in compile_assert_matchingpath()
9678 altbacktrack.cc = ccbegin; in compile_assert_matchingpath()
9679 compile_matchingpath(common, ccbegin + 1 + LINK_SIZE, cc, &altbacktrack); in compile_assert_matchingpath()
9776 if (*cc != OP_ALT) in compile_assert_matchingpath()
9779 ccbegin = cc; in compile_assert_matchingpath()
9780 cc += GET(cc, 1); in compile_assert_matchingpath()
9972 return cc + 1 + LINK_SIZE; in compile_assert_matchingpath()
10137 static PCRE2_SPTR compile_bracket_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_co… in compile_bracket_matchingpath() argument
10160 PUSH_BACKTRACK(sizeof(bracket_backtrack), cc, NULL); in compile_bracket_matchingpath()
10162 if (*cc == OP_BRAZERO || *cc == OP_BRAMINZERO) in compile_bracket_matchingpath()
10164 bra = *cc; in compile_bracket_matchingpath()
10165 cc++; in compile_bracket_matchingpath()
10166 opcode = *cc; in compile_bracket_matchingpath()
10169 opcode = *cc; in compile_bracket_matchingpath()
10170 ccbegin = cc; in compile_bracket_matchingpath()
10171 matchingpath = bracketend(cc) - 1 - LINK_SIZE; in compile_bracket_matchingpath()
10189 cc += GET(cc, 1); in compile_bracket_matchingpath()
10191 has_alternatives = *cc == OP_ALT; in compile_bracket_matchingpath()
10199 if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN)) in compile_bracket_matchingpath()
10503 if (*cc == OP_ALT) in compile_bracket_matchingpath()
10505 matchingpath = cc + 1 + LINK_SIZE; in compile_bracket_matchingpath()
10506 cc += GET(cc, 1); in compile_bracket_matchingpath()
10509 matchingpath = cc; in compile_bracket_matchingpath()
10520 assert->common.cc = matchingpath; in compile_bracket_matchingpath()
10526 compile_matchingpath(common, matchingpath, cc, backtrack); in compile_bracket_matchingpath()
10583 while (*cc == OP_ALT) in compile_bracket_matchingpath()
10585 cc += GET(cc, 1); in compile_bracket_matchingpath()
10686 cc += 1 + LINK_SIZE; in compile_bracket_matchingpath()
10695 return cc + repeat_length; in compile_bracket_matchingpath()
10698 static PCRE2_SPTR compile_bracketpos_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack… in compile_bracketpos_matchingpath() argument
10715 PUSH_BACKTRACK(sizeof(bracketpos_backtrack), cc, NULL); in compile_bracketpos_matchingpath()
10716 if (*cc == OP_BRAPOSZERO) in compile_bracketpos_matchingpath()
10719 cc++; in compile_bracketpos_matchingpath()
10722 opcode = *cc; in compile_bracketpos_matchingpath()
10723 private_data_ptr = PRIVATE_DATA(cc); in compile_bracketpos_matchingpath()
10730 ccbegin = cc + 1 + LINK_SIZE; in compile_bracketpos_matchingpath()
10735 offset = GET2(cc, 1 + LINK_SIZE); in compile_bracketpos_matchingpath()
10741 ccbegin = cc + 1 + LINK_SIZE + IMM2_SIZE; in compile_bracketpos_matchingpath()
10749 framesize = get_framesize(common, cc, NULL, FALSE, &needs_control_head); in compile_bracketpos_matchingpath()
10842 init_frame(common, cc, NULL, stacksize - 1, stacksize - framesize); in compile_bracketpos_matchingpath()
10850 while (*cc != OP_KETRPOS) in compile_bracketpos_matchingpath()
10854 cc += GET(cc, 1); in compile_bracketpos_matchingpath()
10856 compile_matchingpath(common, ccbegin, cc, backtrack); in compile_bracketpos_matchingpath()
10948 if (*cc == OP_KETRPOS) in compile_bracketpos_matchingpath()
10959 if (*cc == OP_KETRPOS) in compile_bracketpos_matchingpath()
10961 ccbegin = cc + 1 + LINK_SIZE; in compile_bracketpos_matchingpath()
10978 return cc + 1 + LINK_SIZE; in compile_bracketpos_matchingpath()
10981 static SLJIT_INLINE PCRE2_SPTR get_iterator_parameters(compiler_common *common, PCRE2_SPTR cc, PCRE… in get_iterator_parameters() argument
10985 *opcode = *cc; in get_iterator_parameters()
10990 cc++; in get_iterator_parameters()
10995 cc++; in get_iterator_parameters()
11001 cc++; in get_iterator_parameters()
11007 cc++; in get_iterator_parameters()
11013 cc++; in get_iterator_parameters()
11021 cc++; in get_iterator_parameters()
11022 class_len = (*type < OP_XCLASS) ? (int)(1 + (32 / sizeof(PCRE2_UCHAR))) : GET(cc, 0); in get_iterator_parameters()
11023 *opcode = cc[class_len - 1]; in get_iterator_parameters()
11028 *end = cc + class_len; in get_iterator_parameters()
11039 *end = cc + class_len; in get_iterator_parameters()
11050 *max = GET2(cc, (class_len + IMM2_SIZE)); in get_iterator_parameters()
11051 *exact = GET2(cc, class_len); in get_iterator_parameters()
11080 *end = cc + class_len + 2 * IMM2_SIZE; in get_iterator_parameters()
11082 return cc; in get_iterator_parameters()
11088 *exact = GET2(cc, 0); in get_iterator_parameters()
11089 cc += IMM2_SIZE; in get_iterator_parameters()
11106 *max = GET2(cc, 0); in get_iterator_parameters()
11107 cc += IMM2_SIZE; in get_iterator_parameters()
11113 *type = *cc; in get_iterator_parameters()
11114 *end = next_opcode(common, cc); in get_iterator_parameters()
11115 cc++; in get_iterator_parameters()
11116 return cc; in get_iterator_parameters()
11119 *end = cc + 1; in get_iterator_parameters()
11121 if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc); in get_iterator_parameters()
11123 return cc; in get_iterator_parameters()
11126 static PCRE2_SPTR compile_iterator_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_c… in compile_iterator_matchingpath() argument
11133 sljit_s32 early_fail_ptr = PRIVATE_DATA(cc + 1); in compile_iterator_matchingpath()
11143 int private_data_ptr = PRIVATE_DATA(cc); in compile_iterator_matchingpath()
11152 PUSH_BACKTRACK(sizeof(char_iterator_backtrack), cc, NULL); in compile_iterator_matchingpath()
11170 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); in compile_iterator_matchingpath()
11198 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE); in compile_iterator_matchingpath()
11206 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); in compile_iterator_matchingpath()
11213 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, TRUE); in compile_iterator_matchingpath()
11246 …compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks,… in compile_iterator_matchingpath()
11371 compile_char1_matchingpath(common, type, cc, &backtrack->topbacktracks, FALSE); in compile_iterator_matchingpath()
11395 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
11440 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
11508 …compile_char1_matchingpath(common, type, cc, &BACKTRACK_AS(char_iterator_backtrack)->u.backtracks,… in compile_iterator_matchingpath()
11535 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
11554 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
11575 compile_char1_matchingpath(common, type, cc, &no_match, FALSE); in compile_iterator_matchingpath()
11609 compile_char1_matchingpath(common, type, cc, &no_char1_match, FALSE); in compile_iterator_matchingpath()
11623 compile_char1_matchingpath(common, type, cc, &no_match, TRUE); in compile_iterator_matchingpath()
11638 …_SPTR compile_fail_accept_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_common *p… in compile_fail_accept_matchingpath() argument
11643 PUSH_BACKTRACK(sizeof(backtrack_common), cc, NULL); in compile_fail_accept_matchingpath()
11645 if (*cc == OP_FAIL) in compile_fail_accept_matchingpath()
11648 return cc + 1; in compile_fail_accept_matchingpath()
11651 if (*cc == OP_ACCEPT && common->currententry == NULL && (common->re->overall_options & PCRE2_ENDANC… in compile_fail_accept_matchingpath()
11654 if (*cc == OP_ASSERT_ACCEPT || common->currententry != NULL || !common->might_be_empty) in compile_fail_accept_matchingpath()
11661 return cc + 1; in compile_fail_accept_matchingpath()
11691 return cc + 1; in compile_fail_accept_matchingpath()
11694 static SLJIT_INLINE PCRE2_SPTR compile_close_matchingpath(compiler_common *common, PCRE2_SPTR cc) in compile_close_matchingpath() argument
11697 int offset = GET2(cc, 1); in compile_close_matchingpath()
11702 return cc + 1 + IMM2_SIZE; in compile_close_matchingpath()
11710 return cc + 1 + IMM2_SIZE; in compile_close_matchingpath()
11713 …SPTR compile_control_verb_matchingpath(compiler_common *common, PCRE2_SPTR cc, backtrack_common *p… in compile_control_verb_matchingpath() argument
11717 PCRE2_UCHAR opcode = *cc; in compile_control_verb_matchingpath()
11718 PCRE2_SPTR ccend = cc + 1; in compile_control_verb_matchingpath()
11722 ccend += 2 + cc[1]; in compile_control_verb_matchingpath()
11724 PUSH_BACKTRACK(sizeof(backtrack_common), cc, NULL); in compile_control_verb_matchingpath()
11737 OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)(cc + 2)); in compile_control_verb_matchingpath()
11747 static SLJIT_INLINE void compile_then_trap_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCR… in compile_then_trap_matchingpath() argument
11754 PUSH_BACKTRACK_NOVALUE(sizeof(then_trap_backtrack), cc); in compile_then_trap_matchingpath()
11756 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_then_trap_matchingpath()
11757 BACKTRACK_AS(then_trap_backtrack)->start = (sljit_sw)(cc - common->start); in compile_then_trap_matchingpath()
11758 BACKTRACK_AS(then_trap_backtrack)->framesize = get_framesize(common, cc, ccend, FALSE, &needs_contr… in compile_then_trap_matchingpath()
11775 init_frame(common, cc, ccend, size - 1, 0); in compile_then_trap_matchingpath()
11778 static void compile_matchingpath(compiler_common *common, PCRE2_SPTR cc, PCRE2_SPTR ccend, backtrac… in compile_matchingpath() argument
11787 if (common->has_then && common->then_offsets[cc - common->start] != 0) in compile_matchingpath()
11793 compile_then_trap_matchingpath(common, cc, ccend, parent); in compile_matchingpath()
11796 while (cc < ccend) in compile_matchingpath()
11798 switch(*cc) in compile_matchingpath()
11811cc = compile_simple_assertion_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top… in compile_matchingpath()
11833cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
11837 PUSH_BACKTRACK_NOVALUE(sizeof(backtrack_common), cc); in compile_matchingpath()
11842 cc++; in compile_matchingpath()
11848cc = compile_charn_matchingpath(common, cc, ccend, parent->top != NULL ? &parent->top->nextbacktra… in compile_matchingpath()
11850cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
11918 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
11923 …if (cc[1 + (32 / sizeof(PCRE2_UCHAR))] >= OP_CRSTAR && cc[1 + (32 / sizeof(PCRE2_UCHAR))] <= OP_CR… in compile_matchingpath()
11924 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
11926cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
11931 if (*(cc + GET(cc, 1)) >= OP_CRSTAR && *(cc + GET(cc, 1)) <= OP_CRPOSRANGE) in compile_matchingpath()
11932 cc = compile_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
11934cc = compile_char1_matchingpath(common, *cc, cc + 1, parent->top != NULL ? &parent->top->nextbackt… in compile_matchingpath()
11940 if (cc[1 + IMM2_SIZE] >= OP_CRSTAR && cc[1 + IMM2_SIZE] <= OP_CRPOSRANGE) in compile_matchingpath()
11941 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
11944 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent-… in compile_matchingpath()
11945 cc += 1 + IMM2_SIZE; in compile_matchingpath()
11951 if (cc[1 + 2 * IMM2_SIZE] >= OP_CRSTAR && cc[1 + 2 * IMM2_SIZE] <= OP_CRPOSRANGE) in compile_matchingpath()
11952 cc = compile_ref_iterator_matchingpath(common, cc, parent); in compile_matchingpath()
11955 …compile_dnref_search(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent->top… in compile_matchingpath()
11956 …compile_ref_matchingpath(common, cc, parent->top != NULL ? &parent->top->nextbacktracks : &parent-… in compile_matchingpath()
11957 cc += 1 + 2 * IMM2_SIZE; in compile_matchingpath()
11962 cc = compile_recurse_matchingpath(common, cc, parent); in compile_matchingpath()
11967 cc = compile_callout_matchingpath(common, cc, parent); in compile_matchingpath()
11974 PUSH_BACKTRACK_NOVALUE(sizeof(assert_backtrack), cc); in compile_matchingpath()
11975 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
11979 PUSH_BACKTRACK_NOVALUE(sizeof(braminzero_backtrack), cc); in compile_matchingpath()
11980 cc = bracketend(cc + 1); in compile_matchingpath()
11981 if (*(cc - 1 - LINK_SIZE) != OP_KETRMIN) in compile_matchingpath()
12006 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
12010 if (cc[1] > OP_ASSERTBACK_NOT) in compile_matchingpath()
12011 cc = compile_bracket_matchingpath(common, cc, parent); in compile_matchingpath()
12014 PUSH_BACKTRACK_NOVALUE(sizeof(assert_backtrack), cc); in compile_matchingpath()
12015 cc = compile_assert_matchingpath(common, cc, BACKTRACK_AS(assert_backtrack), FALSE); in compile_matchingpath()
12024 cc = compile_bracketpos_matchingpath(common, cc, parent); in compile_matchingpath()
12028 PUSH_BACKTRACK_NOVALUE(sizeof(backtrack_common), cc); in compile_matchingpath()
12035 OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, (sljit_sw)(cc + 2)); in compile_matchingpath()
12043 OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(2), SLJIT_IMM, (sljit_sw)(cc + 2)); in compile_matchingpath()
12047 cc += 1 + 2 + cc[1]; in compile_matchingpath()
12058 cc = compile_control_verb_matchingpath(common, cc, parent); in compile_matchingpath()
12064 cc = compile_fail_accept_matchingpath(common, cc, parent); in compile_matchingpath()
12068 cc = compile_close_matchingpath(common, cc); in compile_matchingpath()
12072 cc = bracketend(cc + 1); in compile_matchingpath()
12079 if (cc == NULL) in compile_matchingpath()
12086 PUSH_BACKTRACK_NOVALUE(sizeof(then_trap_backtrack), cc); in compile_matchingpath()
12087 BACKTRACK_AS(then_trap_backtrack)->common.cc = then_trap_opcode; in compile_matchingpath()
12091 SLJIT_ASSERT(cc == ccend); in compile_matchingpath()
12112 PCRE2_SPTR cc = current->cc; in compile_iterator_backtrackingpath() local
12120 int private_data_ptr = PRIVATE_DATA(cc); in compile_iterator_backtrackingpath()
12125 cc = get_iterator_parameters(common, cc, &opcode, &type, &max, &exact, &end); in compile_iterator_backtrackingpath()
12173 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12188 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12215 compile_char1_matchingpath(common, type, cc, &jumplist, TRUE); in compile_iterator_backtrackingpath()
12240 PCRE2_SPTR cc = current->cc; in compile_ref_iterator_backtrackingpath() local
12241 BOOL ref = (*cc == OP_REF || *cc == OP_REFI); in compile_ref_iterator_backtrackingpath()
12244 type = cc[ref ? 1 + IMM2_SIZE : 1 + 2 * IMM2_SIZE]; in compile_ref_iterator_backtrackingpath()
12285 PCRE2_SPTR cc = current->cc; in compile_assert_backtrackingpath() local
12289 SLJIT_ASSERT(*cc != OP_BRAMINZERO); in compile_assert_backtrackingpath()
12290 if (*cc == OP_BRAZERO) in compile_assert_backtrackingpath()
12292 bra = *cc; in compile_assert_backtrackingpath()
12293 cc++; in compile_assert_backtrackingpath()
12317 if (*cc == OP_ASSERT_NOT || *cc == OP_ASSERTBACK_NOT) in compile_assert_backtrackingpath()
12328 if (*cc == OP_ASSERT || *cc == OP_ASSERTBACK) in compile_assert_backtrackingpath()
12358 PCRE2_SPTR cc = current->cc; in compile_bracket_backtrackingpath() local
12374 if (*cc == OP_BRAZERO || *cc == OP_BRAMINZERO) in compile_bracket_backtrackingpath()
12376 bra = *cc; in compile_bracket_backtrackingpath()
12377 cc++; in compile_bracket_backtrackingpath()
12380 opcode = *cc; in compile_bracket_backtrackingpath()
12381 ccbegin = bracketend(cc) - 1 - LINK_SIZE; in compile_bracket_backtrackingpath()
12394 ccbegin = cc; in compile_bracket_backtrackingpath()
12395 cc += GET(cc, 1); in compile_bracket_backtrackingpath()
12396 has_alternatives = *cc == OP_ALT; in compile_bracket_backtrackingpath()
12401 if (SLJIT_UNLIKELY(opcode == OP_COND) && (*cc == OP_KETRMAX || *cc == OP_KETRMIN)) in compile_bracket_backtrackingpath()
12582 if (*cc == OP_ALT) in compile_bracket_backtrackingpath()
12584 ccprev = cc + 1 + LINK_SIZE; in compile_bracket_backtrackingpath()
12585 cc += GET(cc, 1); in compile_bracket_backtrackingpath()
12598 compile_matchingpath(common, ccprev, cc, current); in compile_bracket_backtrackingpath()
12697 while (*cc == OP_ALT); in compile_bracket_backtrackingpath()
12744 cc = ccbegin + GET(ccbegin, 1); in compile_bracket_backtrackingpath()
12750 …stacksize += CURRENT_AS(bracket_backtrack)->u.framesize + ((ket != OP_KET || *cc == OP_ALT) ? 2 : … in compile_bracket_backtrackingpath()
12752 else if (ket == OP_KETRMAX || (*cc == OP_ALT && ket != OP_KETRMIN)) in compile_bracket_backtrackingpath()
12826 if (*current->cc == OP_CBRAPOS || *current->cc == OP_SCBRAPOS) in compile_bracketpos_backtrackingpath()
12828 offset = (GET2(current->cc, 1 + LINK_SIZE)) << 1; in compile_bracketpos_backtrackingpath()
12865 if (current->cc[1] > OP_ASSERTBACK_NOT) in compile_braminzero_backtrackingpath()
12868 compile_bracket_matchingpath(common, current->cc, current); in compile_braminzero_backtrackingpath()
12874 backtrack.common.cc = current->cc; in compile_braminzero_backtrackingpath()
12877 compile_assert_matchingpath(common, current->cc, &backtrack, FALSE); in compile_braminzero_backtrackingpath()
12885 PCRE2_UCHAR opcode = *current->cc; in compile_control_verb_backtrackingpath()
12929 OP1(SLJIT_MOV, SLJIT_R1, 0, SLJIT_IMM, (sljit_sw)(current->cc + 2)); in compile_control_verb_backtrackingpath()
12986 switch(*current->cc) in compile_backtrackingpath()
13099 if (current->cc[1] > OP_ASSERTBACK_NOT) in compile_backtrackingpath()
13171 PCRE2_SPTR cc = common->start + common->currententry->start; in compile_recurse() local
13172 PCRE2_SPTR ccbegin = cc + 1 + LINK_SIZE + (*cc == OP_BRA ? 0 : IMM2_SIZE); in compile_recurse()
13173 PCRE2_SPTR ccend = bracketend(cc) - (1 + LINK_SIZE); in compile_recurse()
13189 SLJIT_ASSERT(*cc == OP_BRA || *cc == OP_CBRA || *cc == OP_CBRAPOS || *cc == OP_SCBRA || *cc == OP_S… in compile_recurse()
13191 alt_max = no_alternatives(cc); in compile_recurse()
13227 altbacktrack.cc = ccbegin; in compile_recurse()
13228 cc += GET(cc, 1); in compile_recurse()
13234 if (altbacktrack.cc != ccbegin) in compile_recurse()
13237 compile_matchingpath(common, altbacktrack.cc, cc, &altbacktrack); in compile_recurse()
13311 if (*cc != OP_ALT) in compile_recurse()
13314 altbacktrack.cc = cc + 1 + LINK_SIZE; in compile_recurse()
13315 cc += GET(cc, 1); in compile_recurse()
13426 rootbacktrack.cc = common->name_table + re->name_count * re->name_entry_size; in jit_compile()
13433 common->start = rootbacktrack.cc; in jit_compile()