develooper Front page | perl.perl5.porters | Postings from September 2012

Another bug while processing posponed regex eval

Thread Next
From:
=?utf-8?B?SmnFmcOtIFbDoWNsYXbDrWs=?=
Date:
September 5, 2012 10:46
Subject:
Another bug while processing posponed regex eval
Message ID:
20120905174407.GA10294@petamem.com
Hello,

this code

my $rx1 = qr{(??{$_ =~ m{[^a]+\z} ? qr{a\A} : qr{.*}})};
my $rx2 = qr{(??{$_ =~ m{(??{$_ =~ m{[^a]+\z} ? qr{a\A} : qr{.*}})} ?
qr{a\A} : qr{.*}})};
for my $str (qw(0 1)) {
    ($str =~ $rx1) or ($str =~ $rx2);
}

produces following warning in perls 5.14.2 and 5.16.1:

Attempt to free unreferenced scalar: SV 0x81a9338, Perl interpreter: 0x81a5008

I think it is a bug, isn't it?

-- 
best regards,

     Jiří Václavík - PetaMem R&D

     - The PetaMem Group - Prague/Nuremberg - www.petamem.com -

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