PATCH: [perl #126253] Nested quantifiers not caught
authorKarl Williamson <khw@cpan.org>
Thu, 22 Oct 2015 03:30:14 +0000 (21:30 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 22 Oct 2015 03:38:53 +0000 (21:38 -0600)
Commit 4fa6dd16d2149c2aeeb32633e3a796d5ebc5b657 added a message
when a quantifier was useless, but then caused the parse to skip it, so
that if it was in an illegal combination, that was no longer caught.

regcomp.c
t/re/re_tests

index f748e79..e4cb083 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -10954,8 +10954,6 @@ S_regpiece(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
                                "Useless use of greediness modifier '%c'",
                                *RExC_parse);
                 }
-                /* Absorb the modifier, so later code doesn't see nor use it */
-                nextchar(pRExC_state);
             }
 
          do_curly:
index ace40f0..6bc0f93 100644 (file)
@@ -1953,6 +1953,8 @@ ab(?#Comment){2}c abbc    y       $&      abbc
 
 (?i    -       c       -       Sequence (?... not terminated
 (?a-x  -       c       -       Sequence (?... not terminated
+.{1}?? -       c       -       Nested quantifiers
+.{1}?+ -       c       -       Nested quantifiers
 
 # Keep these lines at the end of the file
 # vim: softtabstop=0 noexpandtab