diff --git a/ChangeLog b/ChangeLog index c05fccb..ff7fe37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -51,7 +51,8 @@ longer inserted before and after explicit callouts in the pattern. 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 @@ copied). 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 diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c index 345de43..fbc268d 100644 --- a/src/pcre2_compile.c +++ b/src/pcre2_compile.c @@ -2312,7 +2312,7 @@ while (ptr < ptrend) 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 @@ while (ptr < ptrend) } 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); diff --git a/testdata/testinput2 b/testdata/testinput2 index ab20dcc..2f4d7c8 100644 --- a/testdata/testinput2 +++ b/testdata/testinput2 @@ -4920,4 +4920,6 @@ a)"xI /(*:ab)*/ +%(*:(:(svvvvvvvvvv:]*[ Z!*;[]*[^[]*!^[+.+{{2,7}' _\\\\\\\\\\\\\)?.:.. *w////\\\Q\\\\\\\\\\\\\\\T\\\\\+/?/////'+\\\EEE?/////'+/*+/[^K]?]//(w)%never_backslash_c,alt_verbnames,auto_callout + # End of testinput2 diff --git a/testdata/testoutput2 b/testdata/testoutput2 index 5a2d7c8..4bebd7f 100644 --- a/testdata/testoutput2 +++ b/testdata/testoutput2 @@ -15372,6 +15372,8 @@ Failed: error 128 at offset 2: assertion expected after (?( or (?(?C) /(*: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