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

[perl #128225] substitution within (?{}) causes segmentation fault

Thread Previous | Thread Next
From:
Father Chrysostomos via RT
Date:
May 30, 2016 17:18
Subject:
[perl #128225] substitution within (?{}) causes segmentation fault
Message ID:
rt-4.0.18-30393-1464628718-1526.128225-15-0@perl.org
On Mon May 30 05:08:27 2016, davem wrote:
> On Mon, May 23, 2016 at 10:48:26AM -0700, Daniel Șuteu wrote:
> > my $str = "foo";
> > $str =~ /(?{ s{}{} })/;
> 
> As has been pointed out elsewhere in this ticket, an empty pattern
> is interpreted as the "last successful match". The re-eval
> mechanism takes this as being the currently executing pattern,
> and so you get infinite recursion.
> 
> Marking the currently executing pattern as 'last successful'
> is necessary within an re-eval so that things like $1 are visible:
> 
>     #prints "a"
>     "ab" =~ /(.)(?{ print "[$1]\n" })/;
> 

Does the last-successful-match logic use PL_curpm?

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=128225

Thread Previous | Thread Next


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