Revision: 610
http://www.exim.org/viewvc/pcre2?view=rev&revision=610
Author: ph10
Date: 2016-11-27 16:14:33 +0000 (Sun, 27 Nov 2016)
Log Message:
-----------
Fix \Q...\E bug in (*VERB) name when PCRE2_ALT_VERBNAMES and PCRE2_AUTO_CALLOUT
were both specified.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/src/pcre2_compile.c
code/trunk/testdata/testinput2
code/trunk/testdata/testoutput2
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2016-11-25 10:38:38 UTC (rev 609)
+++ code/trunk/ChangeLog 2016-11-27 16:14:33 UTC (rev 610)
@@ -51,7 +51,8 @@
Some bugs in the refactored code were subsequently fixed before release.
Several of them were related to the change from assuming a zero-terminated
pattern (which previously had required non-zero terminated strings to be
-copied).
+copied). These bugs were never in released code, but are noted here for the
+record, once the code was made available in the repository.
(a) An overall recursion such as (?0) inside a lookbehind assertion was not
being diagnosed as an error.
@@ -97,6 +98,9 @@
the called subroutine in the parsed pattern.
(m) Quantifiers following (*VERB)s were not being diagnosed as errors.
+
+ (n) The use of \Q...\E in a (*VERB) name when PCRE2_ALT_VERBNAMES and
+ PCRE2_AUTO_CALLOUT were both specified caused undetermined behaviour.
4. Back references are now permitted in lookbehind assertions when there are
no duplicated group numbers (that is, (?| has not been used), and, if the
Modified: code/trunk/src/pcre2_compile.c
===================================================================
--- code/trunk/src/pcre2_compile.c 2016-11-25 10:38:38 UTC (rev 609)
+++ code/trunk/src/pcre2_compile.c 2016-11-27 16:14:33 UTC (rev 610)
@@ -2312,7 +2312,7 @@
GETCHARINCTEST(c, ptr);
/* Copy quoted literals until \E, allowing for the possibility of automatic
- callouts. */
+ callouts, except when processing a (*VERB) "name". */
if (inescq)
{
@@ -2323,7 +2323,7 @@
}
else
{
- if (after_manual_callout-- <= 0)
+ if (!inverbname && after_manual_callout-- <= 0)
parsed_pattern = manage_callouts(thisptr, &previous_callout, options,
parsed_pattern, cb);
PARSED_LITERAL(c, parsed_pattern);
Modified: code/trunk/testdata/testinput2
===================================================================
--- code/trunk/testdata/testinput2 2016-11-25 10:38:38 UTC (rev 609)
+++ code/trunk/testdata/testinput2 2016-11-27 16:14:33 UTC (rev 610)
@@ -4920,4 +4920,6 @@
/(*:ab)*/
+%(*:?(:?(?svvvvvvvvvv:]*[ Z!*;[]*[^[]*!^[?+.+{{2,7}' _\\\\\\\\\\\\\)?.:.. *w////\\\Q\\\\\\\\\\\\\\\T\\\\\+/?/////'+\\\EEE?/////'+/*+/[^K]?]//(w)%never_backslash_c,alt_verbnames,auto_callout
+
# End of testinput2
Modified: code/trunk/testdata/testoutput2
===================================================================
--- code/trunk/testdata/testoutput2 2016-11-25 10:38:38 UTC (rev 609)
+++ code/trunk/testdata/testoutput2 2016-11-27 16:14:33 UTC (rev 610)
@@ -15372,6 +15372,8 @@
/(*:ab)*/
Failed: error 109 at offset 6: quantifier does not follow a repeatable item
+%(*:?(:?(?svvvvvvvvvv:]*[ Z!*;[]*[^[]*!^[?+.+{{2,7}' _\\\\\\\\\\\\\)?.:.. *w////\\\Q\\\\\\\\\\\\\\\T\\\\\+/?/////'+\\\EEE?/////'+/*+/[^K]?]//(w)%never_backslash_c,alt_verbnames,auto_callout
+
# End of testinput2
Error -63: PCRE2_ERROR_BADDATA (unknown error number)
Error -62: bad serialized data