develooper Front page | perl.perl5.porters | Postings from April 2010

Re: 5.12 regression.

Thread Previous
From:
Abigail
Date:
April 10, 2010 14:21
Subject:
Re: 5.12 regression.
Message ID:
20100410212110.GU17977@almanda
On Sat, Apr 10, 2010 at 10:55:06PM +0200, Abigail wrote:
> On Sat, Apr 10, 2010 at 09:10:22PM +0100, Nicholas Clark wrote:
> > On Sat, Apr 10, 2010 at 08:09:13PM +0200, Abigail wrote:
> > > 
> > > I ran 5.12-RC5 against t/japh/abigail.t. A couple of them failed because
> > > split in scalar context no longer splits to @_.
> > > 
> > > However, there's another failure; a reduced version of it is:
> > > 
> > > 
> > >     $ perl-5.10.1 -wE '$_ = "goto F.say chop;\n=X";F1:eval'
> > >     X
> > >     $ perl-5.12-RC5 -wE '$_ = "goto F.say chop;\n=X";F1:eval'
> > >     X
> > >     =
> > > 
> > 
> > > followed by an infinite amount of newlines.
> > > 
> > > I haven't been able to reduce this to a smaller piece of code. But it 
> > > looks like the eval is working on a copy of $_ which doesn't get updated
> > > when the chop modifies $_.
> > 
> > I bisected with:
> > 
> > #!/bin/sh
> > git clean -dxf
> > # If you can use ccache, add -Dcc=ccache\ gcc -Dld=gcc to the Configure line
> > # if Encode is not needed for the test, you can speed up the bisect by
> > # excluding it from the runs with -Dnoextensions=Encode
> > sh Configure -des -Dusedevel -Doptimize="-g" -Dcc=ccache\ gcc -Dld=gcc
> > test -f config.sh || exit 125
> > # Correct makefile for newer GNU gcc
> > perl -ni -we 'print unless /<(?:built-in|command)/' makefile x2p/makefile
> > # if you just need miniperl, replace test_prep with miniperl
> > make -j4 miniperl
> > [ -x ./miniperl ] || exit 125
> > test `./miniperl -Ilib -wE '$_ = "goto F.say chop;\n=X";F1:eval' | head -2 | wc -l` = 1
> > ret=$?
> > [ $ret -gt 127 ] && ret=127
> > git clean -dxf
> > 
> > 
> > [our recipe in perlrepository.pod should probably run ./Configure </dev/null
> > as one of the bisect points had a MANIFEST error and Configure stopped to ask
> > a question]
> > 
> > It's this commit:
> > 
> > commit dca6062a863d0e957d067cc75f9e13b2e28b1090
> > Author: Nicholas Clark <nick@ccl4.org>
> > Date:   Mon Apr 7 11:29:51 2008 +0000
> > 
> >     Eliminate cop_label from struct cop by storing a label as the first
> >     entry in the hints hash. Most statements don't have labels, so this
> >     will save memory. Not sure how much.
> >     
> >     p4raw-id: //depot/perl@33656
> > 
> >  cop.h              |   14 +++-----------
> >  embed.fnc          |    3 ++-
> >  embed.h            |    2 ++
> >  ext/B/B/Deparse.pm |    3 ++-
> >  global.sym         |    1 +
> >  hv.c               |   25 +++++++++++++++++++++++++
> >  op.c               |   21 ++++++++++++++++-----
> >  proto.h            |    2 +-
> >  8 files changed, 52 insertions(+), 19 deletions(-)
> > 
> > 
> > I don't have any idea why this trips up your computed label code.
> 
> 
> The goto doesn't have to be computed; it fails with a plain goto as well:
> 
>    $_ = 's/fo{2}/bar/; print "foo\n"; goto F unless $x ++'; F: eval;
> 
> with 5.10, it prints "foo\nbar\n", with 5.12, it prints "foo\nfoo\n".
> 
> 
> Add an extra scope, and it behaves as expected:
> 
>    $_ = 's/fo{2}/bar/; print "foo\n"; goto F unless $x ++'; F: {eval};
> 


Even adding a semi-colon makes it behave:

    $_ = 's/fo{2}/bar/; print "foo\n"; goto F unless $x ++'; F:; eval;


Abigail

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