Stop /(a|b)(?=a){3}/ from warning twice
[sprout@dromedary-001 perl2.git]$ ../perl.git/Porting/bisect.pl --target=miniperl --start=perl-5.8.0 --end=v5.10.0 -- ./miniperl -Ilib -we 'BEGIN { $SIG{__WARN__} = sub { die if $_[0] =~ /Quantifier/ && $warned++; warn shift }}; ""=~/(N|N)(?{})?/'
...
07be1b83a6b2d24b492356181ddf70e1c7917ae3 is the first bad commit
commit
07be1b83a6b2d24b492356181ddf70e1c7917ae3
Author: Yves Orton <demerphq@gmail.com>
Date: Fri Jun 9 02:56:37 2006 +0200
Re: [PATCH] Better version of the Aho-Corasick patch and lots of benchmarks.
Message-ID: <9b18b3110606081556t779de698r82f361d82a05fbc8@mail.gmail.com>
(with tweaks)
p4raw-id: //depot/perl@28373
Since that commit, it has been possible for S_study_chunk to be called
twice if the trie optimisation kicks in (which happens for /(a|b)/).
‘Quantifier unexpected on zero-length expression’ is the only warning
in S_study_chunk. Now it can appear twice if the quantified zero-
length expression is in the same regexp as a trie optimisation.
So pass a flag to S_study_chunk when ‘restudying’ to indicate that the
warning should be skipped.
There are two code paths that call S_study_chunk, one for when there
is no top-level alternation, which triggers the error in this case,
and one for when there is a top-level alternation (/a|b/). I wasn’t
able to figure out how to trigger the double warning in the second
case, but I passed the flag for the restudy in that code path anyway,
since I don’t think it can be wrong.