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

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

Thread Previous | Thread Next
From:
=?UTF-8?B?RGFuaWVsIMiYdXRldQ==?= via RT
Date:
May 25, 2016 22:42
Subject:
[perl #128225] substitution within (?{}) causes segmentation fault
Message ID:
rt-4.0.18-20979-1464216140-88.128225-15-0@perl.org
On Wed May 25 15:33:56 2016, trizenx@gmail.com wrote:
> On Mon May 23 14:22:37 2016, demerphq wrote:
> > For what its worth i believe this is safe if you wrap the s/// in a
> > subcall. Obviously this is just a work around and we should fix the
> > core
> > cause....
> > On 23 May 2016 14:51, "Daniel Șuteu via RT" <perlbug-
> > comment@perl.org>
> > wrote:
> >
> > > A somewhat related issue is the following:
> > >
> > > ### BEGIN-CODE ###
> > >
> > > m<
> > >     (?{
> > >         m<(?{
> > >             'print "Just another Perl hacker\n"'
> > >         })>;
> > >
> > > s//$^R/ee;
> > > })
> > > > x;
> > >
> > > //;
> > > //;
> > > //;
> > > //;
> > > //;
> > > //;
> > > //;
> > > //;
> > > //;
> > >
> > > ### END-CODE ###
> > >
> > > The output is "Just another Perl hacker", printed 10 times, for
> > > each empty
> > > match ("//").
> > >
> 
> 
> Seems like not s/// is the issue here, as the following code, where
> s/// was replaced with eval(), behaves the same:
> 
> ### BEGIN-CODE ###
> 
> m{
>     (?{
>         m<(?{
>             'print "Just another Perl hacker\n"'
>         })>;
>         eval $^R;
>     })
> }x;
> 
> //;//;//;//;//;
> 
> ### END-CODE ###
> 
> Probably I should open a new ticket for this?


Code simplified to:

### BEGIN-CODE ###

m{
    (?{ print "hi\n" })
}x;

//;//;//;//;//;

### END-CODE ###

---
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