diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-08-17 09:25:08 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2007-08-17 09:25:08 +0000 |
commit | 996a1205f65d319c3e699e599860cb379c150027 (patch) | |
tree | 9482f74a2917a2b282d8529f8b0936e7c50fc8f7 | |
parent | c6cacc34aeba9ca01c6d754494677ffad6c845b6 (diff) | |
download | pcre-996a1205f65d319c3e699e599860cb379c150027.tar.gz |
Fix bad fix for repeated \p and \P.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@221 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | pcre_compile.c | 22 | ||||
-rw-r--r-- | testdata/testinput6 | 2 | ||||
-rw-r--r-- | testdata/testoutput6 | 2 |
5 files changed, 23 insertions, 11 deletions
@@ -1,7 +1,7 @@ ChangeLog for PCRE ------------------ -Version 7.3 16-Aug-07 +Version 7.3 17-Aug-07 --------------------- 1. In the rejigging of the build system that eventually resulted in 7.1, the @@ -138,6 +138,8 @@ Version 7.3 16-Aug-07 (c) A pattern such as \p{Yi}+(\P{Yi}+)(?1) could give an incorrect "reference to non-existent subpattern" error. + (d) A pattern like (\P{Yi}{2}\277)? could loop at compile time. + 24. A repeated \S or \W in UTF-8 mode could give wrong answers when multibyte characters were involved (for example /\S{2}/8g with "A\x{a3}BC"). diff --git a/configure.ac b/configure.ac index 41dae7b..2b29fe4 100644 --- a/configure.ac +++ b/configure.ac @@ -8,8 +8,8 @@ dnl empty. m4_define(pcre_major, [7]) m4_define(pcre_minor, [3]) -m4_define(pcre_prerelease, [-RC5]) -m4_define(pcre_date, [2007-08-16]) +m4_define(pcre_prerelease, [-RC6]) +m4_define(pcre_date, [2007-08-17]) # Libtool shared library interface versions (current:revision:age) m4_define(libpcre_version, [0:1:0]) diff --git a/pcre_compile.c b/pcre_compile.c index 773a150..05f370a 100644 --- a/pcre_compile.c +++ b/pcre_compile.c @@ -1317,15 +1317,18 @@ for (;;) case OP_TYPEMINPLUS: case OP_TYPEQUERY: case OP_TYPEMINQUERY: - case OP_TYPEUPTO: - case OP_TYPEMINUPTO: - case OP_TYPEEXACT: case OP_TYPEPOSSTAR: case OP_TYPEPOSPLUS: case OP_TYPEPOSQUERY: - case OP_TYPEPOSUPTO: if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2; break; + + case OP_TYPEUPTO: + case OP_TYPEMINUPTO: + case OP_TYPEEXACT: + case OP_TYPEPOSUPTO: + if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2; + break; } /* Add in the fixed length from the table */ @@ -1407,15 +1410,18 @@ for (;;) case OP_TYPEMINPLUS: case OP_TYPEQUERY: case OP_TYPEMINQUERY: - case OP_TYPEUPTO: - case OP_TYPEMINUPTO: - case OP_TYPEEXACT: case OP_TYPEPOSSTAR: case OP_TYPEPOSPLUS: case OP_TYPEPOSQUERY: - case OP_TYPEPOSUPTO: if (code[1] == OP_PROP || code[1] == OP_NOTPROP) code += 2; break; + + case OP_TYPEPOSUPTO: + case OP_TYPEUPTO: + case OP_TYPEMINUPTO: + case OP_TYPEEXACT: + if (code[3] == OP_PROP || code[3] == OP_NOTPROP) code += 2; + break; } /* Add in the fixed length from the table */ diff --git a/testdata/testinput6 b/testdata/testinput6 index 7552280..400b14f 100644 --- a/testdata/testinput6 +++ b/testdata/testinput6 @@ -804,4 +804,6 @@ was broken in all cases./ /\p{Yi}+(\P{Yi}+)(?1)/ +/(\P{Yi}{2}\277)?/ + / End of testinput6 / diff --git a/testdata/testoutput6 b/testdata/testoutput6 index 401b040..2fc2db0 100644 --- a/testdata/testoutput6 +++ b/testdata/testoutput6 @@ -1494,4 +1494,6 @@ No match /\p{Yi}+(\P{Yi}+)(?1)/ +/(\P{Yi}{2}\277)?/ + / End of testinput6 / |