Fix crash when more than one kind of "push" was set in pcre2test.

This commit is contained in:
Philip.Hazel 2017-05-06 16:56:07 +00:00
parent 6e943e5f47
commit 382b64b01c
4 changed files with 67 additions and 42 deletions

View File

@ -153,6 +153,9 @@ tests to improve coverage.
30. Implement (?n: for PCRE2_NO_AUTO_CAPTURE, because Perl now has this.
31. If more than one of "push", "pushcopy", or "pushtablescopy" were set in
pcre2test, a crash could occur.
Version 10.23 14-February-2017
------------------------------

View File

@ -721,12 +721,15 @@ the first control word. Note that CTL_POSIX_NOSUB is always accompanied by
CTL_POSIX, so it doesn't need its own entries. */
static uint32_t exclusive_pat_controls[] = {
CTL_POSIX | CTL_HEXPAT,
CTL_POSIX | CTL_PUSH,
CTL_POSIX | CTL_PUSHCOPY,
CTL_POSIX | CTL_PUSHTABLESCOPY,
CTL_POSIX | CTL_USE_LENGTH,
CTL_EXPAND | CTL_HEXPAT };
CTL_POSIX | CTL_HEXPAT,
CTL_POSIX | CTL_PUSH,
CTL_POSIX | CTL_PUSHCOPY,
CTL_POSIX | CTL_PUSHTABLESCOPY,
CTL_POSIX | CTL_USE_LENGTH,
CTL_PUSH | CTL_PUSHCOPY,
CTL_PUSH | CTL_PUSHTABLESCOPY,
CTL_PUSHCOPY | CTL_PUSHTABLESCOPY,
CTL_EXPAND | CTL_HEXPAT };
/* Data controls that are mutually exclusive. At present these are all in the
first control word. */

View File

@ -97,4 +97,12 @@
#pop
abcd
# Must only specify one of these
//push,pushcopy
//push,pushtablescopy
//pushcopy,pushtablescopy
# End of testinput20

11
testdata/testoutput20 vendored
View File

@ -147,4 +147,15 @@ Serialization failed: error -30: patterns do not all use the same character tabl
abcd
0: abcd
# Must only specify one of these
//push,pushcopy
** Not allowed together: push pushcopy
//push,pushtablescopy
** Not allowed together: push pushtablescopy
//pushcopy,pushtablescopy
** Not allowed together: pushcopy pushtablescopy
# End of testinput20