Adjust tests for workspace overflow and relevant comments in pcre2_compile.c
This commit is contained in:
parent
89b1ae1c98
commit
8dcd23238a
|
@ -98,14 +98,20 @@ static BOOL
|
|||
|
||||
/* This value specifies the size of stack workspace, which is used in different
|
||||
ways in the different pattern scans. The group-identifying pre-scan uses it to
|
||||
handle nesting, and needs it to be 16-bit aligned. During the first compiling
|
||||
phase, when determining how much memory is required, the regex is partly
|
||||
compiled into this space, but the compiled parts are discarded as soon as they
|
||||
can be, so that hopefully there will never be an overrun. The code does,
|
||||
however, check for an overrun. In the real compile phase the workspace is used
|
||||
for remembering data about numbered groups, provided there are not too many of
|
||||
them (if there are, extra memory is acquired). For this phase the memory must
|
||||
be 32-bit aligned. */
|
||||
handle nesting, and needs it to be 16-bit aligned.
|
||||
|
||||
During the first compiling phase, when determining how much memory is required,
|
||||
the regex is partly compiled into this space, but the compiled parts are
|
||||
discarded as soon as they can be, so that hopefully there will never be an
|
||||
overrun. The code does, however, check for an overrun, which can occur for
|
||||
pathological patterns. The size of the workspace depends on LINK_SIZE because
|
||||
the length of compiled items varies with this.
|
||||
|
||||
In the real compile phase, the workspace is used for remembering data about
|
||||
numbered groups, provided there are not too many of them (if there are, extra
|
||||
memory is acquired). For this phase the memory must be 32-bit aligned. Having
|
||||
defined the size in code units, we set up C32_WORK_SIZE as the number of
|
||||
elements in the 32-bit vector. */
|
||||
|
||||
#define COMPILE_WORK_SIZE (2048*LINK_SIZE) /* Size in code units */
|
||||
|
||||
|
|
|
@ -353,6 +353,4 @@
|
|||
|
||||
/(*THEN:\[A]{65501})/expand
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand
|
||||
|
||||
# End of testinput11
|
||||
|
|
|
@ -157,6 +157,14 @@
|
|||
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
/parens_nest_limit=1000,-fullbincode
|
||||
|
||||
# Use "expand" to create some very long patterns with nested parentheses, in
|
||||
# order to test workspace overflow. Again, this varies with code unit width,
|
||||
# and even with it fails in two modes, the error offset differs.
|
||||
|
||||
/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
|
||||
|
||||
/(?(1)(?1)){8,}+()/debug
|
||||
abcd
|
||||
|
||||
|
|
|
@ -258,10 +258,4 @@
|
|||
|
||||
/(*MARK:a\x{100}b)z/alt_verbnames
|
||||
|
||||
# Use "expand" to create some very long patterns
|
||||
|
||||
/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand
|
||||
|
||||
# End of testinput9
|
||||
|
|
|
@ -643,7 +643,4 @@ Subject length lower bound = 1
|
|||
|
||||
/(*THEN:\[A]{65501})/expand
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand
|
||||
Failed: error 186 at offset 594: regular expression is too complicated
|
||||
|
||||
# End of testinput11
|
||||
|
|
|
@ -646,6 +646,4 @@ Subject length lower bound = 1
|
|||
|
||||
/(*THEN:\[A]{65501})/expand
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand
|
||||
|
||||
# End of testinput11
|
||||
|
|
|
@ -850,6 +850,16 @@ Memory allocation (code space): 14
|
|||
/parens_nest_limit=1000,-fullbincode
|
||||
Failed: error 184 at offset 1540: (?| and/or (?J: or (?x: parentheses are too deeply nested
|
||||
|
||||
# Use "expand" to create some very long patterns with nested parentheses, in
|
||||
# order to test workspace overflow. Again, this varies with code unit width,
|
||||
# and even with it fails in two modes, the error offset differs.
|
||||
|
||||
/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
|
||||
Failed: error 186 at offset 594: regular expression is too complicated
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
|
||||
Failed: error 186 at offset 594: regular expression is too complicated
|
||||
|
||||
/(?(1)(?1)){8,}+()/debug
|
||||
------------------------------------------------------------------
|
||||
0 79 Bra
|
||||
|
|
|
@ -849,6 +849,14 @@ Memory allocation (code space): 28
|
|||
)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
|
||||
/parens_nest_limit=1000,-fullbincode
|
||||
|
||||
# Use "expand" to create some very long patterns with nested parentheses, in
|
||||
# order to test workspace overflow. Again, this varies with code unit width,
|
||||
# and even with it fails in two modes, the error offset differs.
|
||||
|
||||
/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
|
||||
|
||||
/(?(1)(?1)){8,}+()/debug
|
||||
------------------------------------------------------------------
|
||||
0 79 Bra
|
||||
|
|
|
@ -850,6 +850,15 @@ Memory allocation (code space): 10
|
|||
/parens_nest_limit=1000,-fullbincode
|
||||
Failed: error 184 at offset 1540: (?| and/or (?J: or (?x: parentheses are too deeply nested
|
||||
|
||||
# Use "expand" to create some very long patterns with nested parentheses, in
|
||||
# order to test workspace overflow. Again, this varies with code unit width,
|
||||
# and even with it fails in two modes, the error offset differs.
|
||||
|
||||
/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand,-fullbincode
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand,-fullbincode
|
||||
Failed: error 186 at offset 637: regular expression is too complicated
|
||||
|
||||
/(?(1)(?1)){8,}+()/debug
|
||||
------------------------------------------------------------------
|
||||
0 119 Bra
|
||||
|
|
|
@ -364,11 +364,4 @@ Failed: error 177 at offset 6: character code point value in \u.... sequence is
|
|||
/(*MARK:a\x{100}b)z/alt_verbnames
|
||||
Failed: error 134 at offset 14: character code point value in \x{} or \o{} is too large
|
||||
|
||||
# Use "expand" to create some very long patterns
|
||||
|
||||
/(?'ABC'\[[bar](]{105}*THEN:\[A]{255}\[)]{106}/expand
|
||||
|
||||
/(?'ABC'\[[bar](]{106}*THEN:\[A]{255}\[)]{107}/expand
|
||||
Failed: error 186 at offset 637: regular expression is too complicated
|
||||
|
||||
# End of testinput9
|
||||
|
|
Loading…
Reference in New Issue