This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
the test for #129897 was missing the min-mod (?) on the dot star
authorYves Orton <demerphq@gmail.com>
Thu, 20 Oct 2016 16:20:20 +0000 (18:20 +0200)
committerYves Orton <demerphq@gmail.com>
Thu, 20 Oct 2016 16:24:03 +0000 (18:24 +0200)
A plain .* will make the pattern match skip the bug we
are testing for. We need .*? to see the difference

Fixed:
./perl -Ilib -le'"riiaan"=~/(.*?(a(a)|i(i))n)/ and print "$2-$3-$4-$1"'
aa-a--riiaan

Broken:
perl -le'"riiaan"=~/(.*?(a(a)|i(i))n)/ and print "$2-$3-$4-$1"'
aa-a-i-riiaan

Maybe the test could make this more explicit. Not sure if its
worth it.

Thanks to Aaron Crane for noticing the test didn't do what it was
meant to. Bad Yves.

t/re/re_tests

index d6f8436..046beaa 100644 (file)
@@ -1970,7 +1970,7 @@ aa$|a(?R)a|a      aaa     y       $&      aaa             # [perl 128420] recursive matches
 (?:\1|a)([bcd])\1(?:(?R)|e)\1  abbaccaddedcb   y       $&      abbaccaddedcb           # [perl 128420] recursive match with backreferences
 AB\s+\x{100}   AB \x{100}X     y       -       -
 \b\z0*\x{100}  .\x{100}        n       -       -       # [perl #129350] crashed in intuit_start
-(.*(a(a)|i(i))n)       riiaan  y       $2-$3-$4-$1     aa-a--riiaan            #  Jump trie capture buffer issue [perl #129897]
+(.*?(a(a)|i(i))n)      riiaan  y       $2-$3-$4-$1     aa-a--riiaan            #  Jump trie capture buffer issue [perl #129897]
 (^(?:(\d)x)?\d$)       1       y       [$1-$2] [1-]            #  make sure that we reset capture buffers properly (from regtry)
 
 # Keep these lines at the end of the file