develooper Front page | perl.perl5.porters | Postings from October 2016

Re: [perl #129903] regexec.c stack overflow

Thread Previous | Thread Next
October 18, 2016 09:29
Re: [perl #129903] regexec.c stack overflow
Message ID:
On 18 October 2016 at 10:21, demerphq <> wrote:
> On 18 October 2016 at 10:17, demerphq <> wrote:
>> ... Apparently
>> the problem is related to the empty-pattern special case behavior.
> [...]
>> This is definitely a bug.
> And yet another example of the empty pattern special case causing
> problems. Sigh, so much trouble for so little value.

Actually this case can be boiled down to:

./perl -le'/(?{ s!!! })/'

which causes an infinite loop due to PL_curpm being set at the start
of the match, which the s!!! then sees as the "last successful match".
IMO it shouldn't as the outer match hasn't actually finished yet, but
because of when and how we set up PL_curpm at match start we have this
problem inside of (?{ }) constructs.

I think we can fix it by checking PL_curpm against PL_reg_curpm when
we do the empty pattern check; running tests now.


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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About