develooper Front page | perl.perl5.porters | Postings from July 2013

Re: [perl #119071] Misdiagnosed regex infinite recursion

Thread Previous
From:
demerphq
Date:
July 30, 2013 11:17
Subject:
Re: [perl #119071] Misdiagnosed regex infinite recursion
Message ID:
CANgJU+Ugkf95RRY+=KzWSAd+UhAZ-585=CQcY58upaVA6Mnzag@mail.gmail.com
imo yes

On 30 July 2013 02:46, James E Keenan via RT <perlbug-followup@perl.org> wrote:
> On Mon Jul 29 10:22:42 2013, nicholas wrote:
>> On Mon, Jul 29, 2013 at 07:20:13PM +0200, demerphq wrote:
>> > On 29 July 2013 18:17, Philip Hazel <perlbug-followup@perl.org>
>> wrote:
>>
>> > > $ perl -e 'x =~ /(?:(a(*SKIP)b)){0}(?:(?1)|ac)/'
>> > > Infinite recursion in regex at -e line 1.
>> > >
>> > > As far as I can see, there is no infinite recursion here.
>> Capturing group
>> > > number 1 is (a(*SKIP)b) and that does not do any recursing, so
>> calling
>> > > it via (?1) is just a single recursion.
>> >
>> > This looks to me like another example of {0} => NOTHING optimization
>> > not playing nicely with recursive patterns.
>>
>> Yes, caused by commit 3018b823898645e44b8c37c70ac5c6302b031381
>>
>> Fixed by commit 2e3a23da260a7ec5d61b81cb34c38de5e528b41d
>>
>> Nicholas Clark
>>
>
>
> $ ./perl -Ilib -v | head -3 | tail -2This is perl 5, version 19,
> subversion 3 (v5.19.3 (v5.19.2-208-g5c24ac0)) built for darwin-2level
>
> $ ./perl -Ilib -E 'if (x =~ /(?:(a(*SKIP)b)){0}(?:(?1)|ac)/) {say "yes"}
> else { say "no"};'
> no
>
>
> Is this ticket closable?
>
> ---
> via perlbug:  queue: perl5 status: open
> https://rt.perl.org:443/rt3/Ticket/Display.html?id=119071



-- 
perl -Mre=debug -e "/just|another|perl|hacker/"

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About