633 |
{ CMA, 0 | F_FORCECONV, "[\xed\xa0\x80][\xed\xb0\x80]{2,}", "\xed\xa0\x80\xed\xb0\x80\xed\xa0\x80\xed\xb0\x80\xed\xb0\x80\xed\xb0\x80" }, |
{ CMA, 0 | F_FORCECONV, "[\xed\xa0\x80][\xed\xb0\x80]{2,}", "\xed\xa0\x80\xed\xb0\x80\xed\xa0\x80\xed\xb0\x80\xed\xb0\x80\xed\xb0\x80" }, |
634 |
{ MA, 0 | F_FORCECONV, "[^\xed\xb0\x80]{3,}?", "##\xed\xb0\x80#\xed\xb0\x80#\xc3\x89#\xed\xb0\x80" }, |
{ MA, 0 | F_FORCECONV, "[^\xed\xb0\x80]{3,}?", "##\xed\xb0\x80#\xed\xb0\x80#\xc3\x89#\xed\xb0\x80" }, |
635 |
{ MA, 0 | F_NO8 | F_FORCECONV, "[^\\x{dc00}]{3,}?", "##\xed\xb0\x80#\xed\xb0\x80#\xc3\x89#\xed\xb0\x80" }, |
{ MA, 0 | F_NO8 | F_FORCECONV, "[^\\x{dc00}]{3,}?", "##\xed\xb0\x80#\xed\xb0\x80#\xc3\x89#\xed\xb0\x80" }, |
636 |
|
{ CMA, 0 | F_FORCECONV, ".\\B.", "\xed\xa0\x80\xed\xb0\x80" }, |
637 |
|
{ CMA, 0 | F_FORCECONV, "\\D+(?:\\d+|.)\\S+(?:\\s+|.)\\W+(?:\\w+|.)\xed\xa0\x80\xed\xa0\x80", "\xed\xa0\x80\xed\xa0\x80\xed\xa0\x80\xed\xa0\x80\xed\xa0\x80\xed\xa0\x80\xed\xa0\x80\xed\xa0\x80" }, |
638 |
|
{ CMA, 0 | F_FORCECONV, "\\d*\\s*\\w*\xed\xa0\x80\xed\xa0\x80", "\xed\xa0\x80\xed\xa0\x80" }, |
639 |
|
{ CMA, 0 | F_FORCECONV | F_NOMATCH, "\\d*?\\D*?\\s*?\\S*?\\w*?\\W*?##", "\xed\xa0\x80\xed\xa0\x80\xed\xa0\x80\xed\xa0\x80#" }, |
640 |
|
{ CMA | PCRE_EXTENDED, 0 | F_FORCECONV, "\xed\xa0\x80 \xed\xb0\x80 !", "\xed\xa0\x80\xed\xb0\x80!" }, |
641 |
|
|
642 |
/* Deep recursion. */ |
/* Deep recursion. */ |
643 |
{ MUA, 0, "((((?:(?:(?:\\w)+)?)*|(?>\\w)+?)+|(?>\\w)?\?)*)?\\s", "aaaaa+ " }, |
{ MUA, 0, "((((?:(?:(?:\\w)+)?)*|(?>\\w)+?)+|(?>\\w)?\?)*)?\\s", "aaaaa+ " }, |
654 |
{ 0, 0, NULL, NULL } |
{ 0, 0, NULL, NULL } |
655 |
}; |
}; |
656 |
|
|
657 |
|
static const unsigned char *tables(int release) |
658 |
|
{ |
659 |
|
/* The purpose of this function to allow valgrind |
660 |
|
for reporting invalid reads and writes. */ |
661 |
|
static unsigned char *tables_copy; |
662 |
|
pcre *regex; |
663 |
|
const char *errorptr; |
664 |
|
int erroroffset; |
665 |
|
const unsigned char *default_tables; |
666 |
|
#ifdef SUPPORT_PCRE8 |
667 |
|
char null_str[1] = { 0 }; |
668 |
|
#else |
669 |
|
PCRE_SCHAR16 null_str[1] = { 0 }; |
670 |
|
#endif |
671 |
|
|
672 |
|
if (release) { |
673 |
|
if (tables_copy) |
674 |
|
free(tables_copy); |
675 |
|
tables_copy = NULL; |
676 |
|
return NULL; |
677 |
|
} |
678 |
|
|
679 |
|
if (tables_copy) |
680 |
|
return tables_copy; |
681 |
|
|
682 |
|
default_tables = NULL; |
683 |
|
#ifdef SUPPORT_PCRE8 |
684 |
|
regex = pcre_compile(null_str, 0, &errorptr, &erroroffset, NULL); |
685 |
|
if (regex) { |
686 |
|
pcre_fullinfo(regex, NULL, PCRE_INFO_DEFAULT_TABLES, &default_tables); |
687 |
|
pcre_free(regex); |
688 |
|
} |
689 |
|
#else |
690 |
|
regex = pcre16_compile(null_str, 0, &errorptr, &erroroffset, NULL); |
691 |
|
if (regex) { |
692 |
|
pcre16_fullinfo(regex, NULL, PCRE_INFO_DEFAULT_TABLES, &default_tables); |
693 |
|
pcre16_free(regex); |
694 |
|
} |
695 |
|
#endif |
696 |
|
/* Shouldn't ever happen. */ |
697 |
|
if (!default_tables) |
698 |
|
return NULL; |
699 |
|
|
700 |
|
/* This value cannot get from pcre_fullinfo. Since this is a test program, |
701 |
|
we can live with it at the moment. */ |
702 |
|
tables_copy = (unsigned char *)malloc(1088); |
703 |
|
if (!tables_copy) |
704 |
|
return NULL; |
705 |
|
|
706 |
|
memcpy(tables_copy, default_tables, 1088); |
707 |
|
return tables_copy; |
708 |
|
} |
709 |
|
|
710 |
static pcre_jit_stack* callback(void *arg) |
static pcre_jit_stack* callback(void *arg) |
711 |
{ |
{ |
712 |
return (pcre_jit_stack *)arg; |
return (pcre_jit_stack *)arg; |
860 |
if (!(current->start_offset & F_NO8)) |
if (!(current->start_offset & F_NO8)) |
861 |
re8 = pcre_compile(current->pattern, |
re8 = pcre_compile(current->pattern, |
862 |
current->flags & ~(PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | disabled_flags8), |
current->flags & ~(PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | disabled_flags8), |
863 |
&error, &err_offs, NULL); |
&error, &err_offs, tables(0)); |
864 |
|
|
865 |
extra8 = NULL; |
extra8 = NULL; |
866 |
if (re8) { |
if (re8) { |
890 |
if (!(current->start_offset & F_NO16)) |
if (!(current->start_offset & F_NO16)) |
891 |
re16 = pcre16_compile(regtest_buf, |
re16 = pcre16_compile(regtest_buf, |
892 |
current->flags & ~(PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | disabled_flags16), |
current->flags & ~(PCRE_NOTBOL | PCRE_NOTEOL | PCRE_NOTEMPTY | PCRE_NOTEMPTY_ATSTART | disabled_flags16), |
893 |
&error, &err_offs, NULL); |
&error, &err_offs, tables(0)); |
894 |
|
|
895 |
extra16 = NULL; |
extra16 = NULL; |
896 |
if (re16) { |
if (re16) { |
898 |
extra16 = pcre16_study(re16, PCRE_STUDY_JIT_COMPILE, &error); |
extra16 = pcre16_study(re16, PCRE_STUDY_JIT_COMPILE, &error); |
899 |
if (!extra16) { |
if (!extra16) { |
900 |
printf("\n16 bit: Cannot study pattern: %s\n", current->pattern); |
printf("\n16 bit: Cannot study pattern: %s\n", current->pattern); |
901 |
pcre_free(re16); |
pcre16_free(re16); |
902 |
re16 = NULL; |
re16 = NULL; |
903 |
} |
} |
904 |
if (!(extra16->flags & PCRE_EXTRA_EXECUTABLE_JIT)) { |
if (!(extra16->flags & PCRE_EXTRA_EXECUTABLE_JIT)) { |
905 |
printf("\n16 bit: JIT compiler does not support: %s\n", current->pattern); |
printf("\n16 bit: JIT compiler does not support: %s\n", current->pattern); |
906 |
pcre_free_study(extra16); |
pcre16_free_study(extra16); |
907 |
pcre_free(re16); |
pcre16_free(re16); |
908 |
re16 = NULL; |
re16 = NULL; |
909 |
} |
} |
910 |
} else if (utf16 && ucp16 && !(current->start_offset & F_NO16)) |
} else if (utf16 && ucp16 && !(current->start_offset & F_NO16)) |
1069 |
#ifdef SUPPORT_PCRE16 |
#ifdef SUPPORT_PCRE16 |
1070 |
if (re16) { |
if (re16) { |
1071 |
pcre16_free_study(extra16); |
pcre16_free_study(extra16); |
1072 |
pcre_free(re16); |
pcre16_free(re16); |
1073 |
} |
} |
1074 |
#endif |
#endif |
1075 |
|
|
1078 |
fflush(stdout); |
fflush(stdout); |
1079 |
current++; |
current++; |
1080 |
} |
} |
1081 |
|
tables(1); |
1082 |
|
|
1083 |
if (total == successful) { |
if (total == successful) { |
1084 |
printf("\nAll JIT regression tests are successfully passed.\n"); |
printf("\nAll JIT regression tests are successfully passed.\n"); |