|
|
| version 1.1.1.4, 2013/07/22 08:25:55 | version 1.1.1.5, 2014/06/15 19:46:04 |
|---|---|
| Line 120 static const pcre_uint8 coptable[] = { | Line 120 static const pcre_uint8 coptable[] = { |
| 0, 0, /* \P, \p */ | 0, 0, /* \P, \p */ |
| 0, 0, 0, 0, 0, /* \R, \H, \h, \V, \v */ | 0, 0, 0, 0, 0, /* \R, \H, \h, \V, \v */ |
| 0, /* \X */ | 0, /* \X */ |
| 0, 0, 0, 0, 0, 0, /* \Z, \z, ^, ^M, $, $M */ | 0, 0, 0, 0, 0, 0, /* \Z, \z, $, $M, ^, ^M */ |
| 1, /* Char */ | 1, /* Char */ |
| 1, /* Chari */ | 1, /* Chari */ |
| 1, /* not */ | 1, /* not */ |
| Line 151 static const pcre_uint8 coptable[] = { | Line 151 static const pcre_uint8 coptable[] = { |
| /* Character class & ref repeats */ | /* Character class & ref repeats */ |
| 0, 0, 0, 0, 0, 0, /* *, *?, +, +?, ?, ?? */ | 0, 0, 0, 0, 0, 0, /* *, *?, +, +?, ?, ?? */ |
| 0, 0, /* CRRANGE, CRMINRANGE */ | 0, 0, /* CRRANGE, CRMINRANGE */ |
| 0, 0, 0, 0, /* Possessive *+, ++, ?+, CRPOSRANGE */ | |
| 0, /* CLASS */ | 0, /* CLASS */ |
| 0, /* NCLASS */ | 0, /* NCLASS */ |
| 0, /* XCLASS - variable length */ | 0, /* XCLASS - variable length */ |
| 0, /* REF */ | 0, /* REF */ |
| 0, /* REFI */ | 0, /* REFI */ |
| 0, /* DNREF */ | |
| 0, /* DNREFI */ | |
| 0, /* RECURSE */ | 0, /* RECURSE */ |
| 0, /* CALLOUT */ | 0, /* CALLOUT */ |
| 0, /* Alt */ | 0, /* Alt */ |
| Line 171 static const pcre_uint8 coptable[] = { | Line 174 static const pcre_uint8 coptable[] = { |
| 0, 0, /* ONCE, ONCE_NC */ | 0, 0, /* ONCE, ONCE_NC */ |
| 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ | 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ |
| 0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */ | 0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */ |
| 0, 0, /* CREF, NCREF */ | 0, 0, /* CREF, DNCREF */ |
| 0, 0, /* RREF, NRREF */ | 0, 0, /* RREF, DNRREF */ |
| 0, /* DEF */ | 0, /* DEF */ |
| 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ | 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ |
| 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ | 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ |
| Line 194 static const pcre_uint8 poptable[] = { | Line 197 static const pcre_uint8 poptable[] = { |
| 1, 1, /* \P, \p */ | 1, 1, /* \P, \p */ |
| 1, 1, 1, 1, 1, /* \R, \H, \h, \V, \v */ | 1, 1, 1, 1, 1, /* \R, \H, \h, \V, \v */ |
| 1, /* \X */ | 1, /* \X */ |
| 0, 0, 0, 0, 0, 0, /* \Z, \z, ^, ^M, $, $M */ | 0, 0, 0, 0, 0, 0, /* \Z, \z, $, $M, ^, ^M */ |
| 1, /* Char */ | 1, /* Char */ |
| 1, /* Chari */ | 1, /* Chari */ |
| 1, /* not */ | 1, /* not */ |
| Line 220 static const pcre_uint8 poptable[] = { | Line 223 static const pcre_uint8 poptable[] = { |
| /* Character class & ref repeats */ | /* Character class & ref repeats */ |
| 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ | 1, 1, 1, 1, 1, 1, /* *, *?, +, +?, ?, ?? */ |
| 1, 1, /* CRRANGE, CRMINRANGE */ | 1, 1, /* CRRANGE, CRMINRANGE */ |
| 1, 1, 1, 1, /* Possessive *+, ++, ?+, CRPOSRANGE */ | |
| 1, /* CLASS */ | 1, /* CLASS */ |
| 1, /* NCLASS */ | 1, /* NCLASS */ |
| 1, /* XCLASS - variable length */ | 1, /* XCLASS - variable length */ |
| 0, /* REF */ | 0, /* REF */ |
| 0, /* REFI */ | 0, /* REFI */ |
| 0, /* DNREF */ | |
| 0, /* DNREFI */ | |
| 0, /* RECURSE */ | 0, /* RECURSE */ |
| 0, /* CALLOUT */ | 0, /* CALLOUT */ |
| 0, /* Alt */ | 0, /* Alt */ |
| Line 240 static const pcre_uint8 poptable[] = { | Line 246 static const pcre_uint8 poptable[] = { |
| 0, 0, /* ONCE, ONCE_NC */ | 0, 0, /* ONCE, ONCE_NC */ |
| 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ | 0, 0, 0, 0, 0, /* BRA, BRAPOS, CBRA, CBRAPOS, COND */ |
| 0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */ | 0, 0, 0, 0, 0, /* SBRA, SBRAPOS, SCBRA, SCBRAPOS, SCOND */ |
| 0, 0, /* CREF, NCREF */ | 0, 0, /* CREF, DNCREF */ |
| 0, 0, /* RREF, NRREF */ | 0, 0, /* RREF, DNRREF */ |
| 0, /* DEF */ | 0, /* DEF */ |
| 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ | 0, 0, 0, /* BRAZERO, BRAMINZERO, BRAPOSZERO */ |
| 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ | 0, 0, 0, /* MARK, PRUNE, PRUNE_ARG */ |
| Line 1094 for (;;) | Line 1100 for (;;) |
| PRIV(ucp_gentype)[prop->chartype] == ucp_N; | PRIV(ucp_gentype)[prop->chartype] == ucp_N; |
| break; | break; |
| case PT_SPACE: /* Perl space */ | /* Perl space used to exclude VT, but from Perl 5.18 it is included, |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z || | which means that Perl space and POSIX space are now identical. PCRE |
| c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR; | was changed at release 8.34. */ |
| break; | |
| case PT_SPACE: /* Perl space */ | |
| case PT_PXSPACE: /* POSIX space */ | case PT_PXSPACE: /* POSIX space */ |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z || | switch(c) |
| c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || | { |
| c == CHAR_FF || c == CHAR_CR; | HSPACE_CASES: |
| VSPACE_CASES: | |
| OK = TRUE; | |
| break; | |
| default: | |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z; | |
| break; | |
| } | |
| break; | break; |
| case PT_WORD: | case PT_WORD: |
| Line 1344 for (;;) | Line 1358 for (;;) |
| PRIV(ucp_gentype)[prop->chartype] == ucp_N; | PRIV(ucp_gentype)[prop->chartype] == ucp_N; |
| break; | break; |
| case PT_SPACE: /* Perl space */ | /* Perl space used to exclude VT, but from Perl 5.18 it is included, |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z || | which means that Perl space and POSIX space are now identical. PCRE |
| c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR; | was changed at release 8.34. */ |
| break; | |
| case PT_SPACE: /* Perl space */ | |
| case PT_PXSPACE: /* POSIX space */ | case PT_PXSPACE: /* POSIX space */ |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z || | switch(c) |
| c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || | { |
| c == CHAR_FF || c == CHAR_CR; | HSPACE_CASES: |
| VSPACE_CASES: | |
| OK = TRUE; | |
| break; | |
| default: | |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z; | |
| break; | |
| } | |
| break; | break; |
| case PT_WORD: | case PT_WORD: |
| Line 1588 for (;;) | Line 1610 for (;;) |
| PRIV(ucp_gentype)[prop->chartype] == ucp_N; | PRIV(ucp_gentype)[prop->chartype] == ucp_N; |
| break; | break; |
| case PT_SPACE: /* Perl space */ | /* Perl space used to exclude VT, but from Perl 5.18 it is included, |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z || | which means that Perl space and POSIX space are now identical. PCRE |
| c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR; | was changed at release 8.34. */ |
| break; | |
| case PT_SPACE: /* Perl space */ | |
| case PT_PXSPACE: /* POSIX space */ | case PT_PXSPACE: /* POSIX space */ |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z || | switch(c) |
| c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || | { |
| c == CHAR_FF || c == CHAR_CR; | HSPACE_CASES: |
| VSPACE_CASES: | |
| OK = TRUE; | |
| break; | |
| default: | |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z; | |
| break; | |
| } | |
| break; | break; |
| case PT_WORD: | case PT_WORD: |
| Line 1857 for (;;) | Line 1887 for (;;) |
| PRIV(ucp_gentype)[prop->chartype] == ucp_N; | PRIV(ucp_gentype)[prop->chartype] == ucp_N; |
| break; | break; |
| case PT_SPACE: /* Perl space */ | /* Perl space used to exclude VT, but from Perl 5.18 it is included, |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z || | which means that Perl space and POSIX space are now identical. PCRE |
| c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR; | was changed at release 8.34. */ |
| break; | |
| case PT_SPACE: /* Perl space */ | |
| case PT_PXSPACE: /* POSIX space */ | case PT_PXSPACE: /* POSIX space */ |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z || | switch(c) |
| c == CHAR_HT || c == CHAR_NL || c == CHAR_VT || | { |
| c == CHAR_FF || c == CHAR_CR; | HSPACE_CASES: |
| VSPACE_CASES: | |
| OK = TRUE; | |
| break; | |
| default: | |
| OK = PRIV(ucp_gentype)[prop->chartype] == ucp_Z; | |
| break; | |
| } | |
| break; | break; |
| case PT_WORD: | case PT_WORD: |
| Line 2533 for (;;) | Line 2571 for (;;) |
| { | { |
| case OP_CRSTAR: | case OP_CRSTAR: |
| case OP_CRMINSTAR: | case OP_CRMINSTAR: |
| case OP_CRPOSSTAR: | |
| ADD_ACTIVE(next_state_offset + 1, 0); | ADD_ACTIVE(next_state_offset + 1, 0); |
| if (isinclass) { ADD_NEW(state_offset, 0); } | if (isinclass) |
| { | |
| if (*ecode == OP_CRPOSSTAR) | |
| { | |
| active_count--; /* Remove non-match possibility */ | |
| next_active_state--; | |
| } | |
| ADD_NEW(state_offset, 0); | |
| } | |
| break; | break; |
| case OP_CRPLUS: | case OP_CRPLUS: |
| case OP_CRMINPLUS: | case OP_CRMINPLUS: |
| case OP_CRPOSPLUS: | |
| count = current_state->count; /* Already matched */ | count = current_state->count; /* Already matched */ |
| if (count > 0) { ADD_ACTIVE(next_state_offset + 1, 0); } | if (count > 0) { ADD_ACTIVE(next_state_offset + 1, 0); } |
| if (isinclass) { count++; ADD_NEW(state_offset, count); } | if (isinclass) |
| { | |
| if (count > 0 && *ecode == OP_CRPOSPLUS) | |
| { | |
| active_count--; /* Remove non-match possibility */ | |
| next_active_state--; | |
| } | |
| count++; | |
| ADD_NEW(state_offset, count); | |
| } | |
| break; | break; |
| case OP_CRQUERY: | case OP_CRQUERY: |
| case OP_CRMINQUERY: | case OP_CRMINQUERY: |
| case OP_CRPOSQUERY: | |
| ADD_ACTIVE(next_state_offset + 1, 0); | ADD_ACTIVE(next_state_offset + 1, 0); |
| if (isinclass) { ADD_NEW(next_state_offset + 1, 0); } | if (isinclass) |
| { | |
| if (*ecode == OP_CRPOSQUERY) | |
| { | |
| active_count--; /* Remove non-match possibility */ | |
| next_active_state--; | |
| } | |
| ADD_NEW(next_state_offset + 1, 0); | |
| } | |
| break; | break; |
| case OP_CRRANGE: | case OP_CRRANGE: |
| case OP_CRMINRANGE: | case OP_CRMINRANGE: |
| case OP_CRPOSRANGE: | |
| count = current_state->count; /* Already matched */ | count = current_state->count; /* Already matched */ |
| if (count >= (int)GET2(ecode, 1)) | if (count >= (int)GET2(ecode, 1)) |
| { ADD_ACTIVE(next_state_offset + 1 + 2 * IMM2_SIZE, 0); } | { ADD_ACTIVE(next_state_offset + 1 + 2 * IMM2_SIZE, 0); } |
| if (isinclass) | if (isinclass) |
| { | { |
| int max = (int)GET2(ecode, 1 + IMM2_SIZE); | int max = (int)GET2(ecode, 1 + IMM2_SIZE); |
| if (*ecode == OP_CRPOSRANGE) | |
| { | |
| active_count--; /* Remove non-match possibility */ | |
| next_active_state--; | |
| } | |
| if (++count >= max && max != 0) /* Max 0 => no limit */ | if (++count >= max && max != 0) /* Max 0 => no limit */ |
| { ADD_NEW(next_state_offset + 1 + 2 * IMM2_SIZE, 0); } | { ADD_NEW(next_state_offset + 1 + 2 * IMM2_SIZE, 0); } |
| else | else |
| Line 2657 for (;;) | Line 2729 for (;;) |
| condcode = code[LINK_SIZE+1]; | condcode = code[LINK_SIZE+1]; |
| /* Back reference conditions are not supported */ | /* Back reference conditions and duplicate named recursion conditions |
| are not supported */ | |
| if (condcode == OP_CREF || condcode == OP_NCREF) | if (condcode == OP_CREF || condcode == OP_DNCREF || |
| condcode == OP_DNRREF) | |
| return PCRE_ERROR_DFA_UCOND; | return PCRE_ERROR_DFA_UCOND; |
| /* The DEFINE condition is always false */ | /* The DEFINE condition is always false */ |
| Line 2671 for (;;) | Line 2745 for (;;) |
| which means "test if in any recursion". We can't test for specifically | which means "test if in any recursion". We can't test for specifically |
| recursed groups. */ | recursed groups. */ |
| else if (condcode == OP_RREF || condcode == OP_NRREF) | else if (condcode == OP_RREF) |
| { | { |
| int value = GET2(code, LINK_SIZE + 2); | int value = GET2(code, LINK_SIZE + 2); |
| if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND; | if (value != RREF_ANY) return PCRE_ERROR_DFA_UCOND; |