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

Re: [perl.git] branch blead, updated. v5.19.3-629-g839a0e5

Thread Next
From:
Tony Cook
Date:
September 19, 2013 22:54
Subject:
Re: [perl.git] branch blead, updated. v5.19.3-629-g839a0e5
Message ID:
20130919225357.GA18474@mars.tony.develop-help.com
On Tue, Sep 17, 2013 at 05:32:14PM +0200, Father Chrysostomos wrote:
> commit acb3405042618ee03217199647b0b92863b95088
> Author: Father Chrysostomos <sprout@cpan.org>
> Date:   Tue Sep 17 08:26:12 2013 -0700
> 
>     [perl #119501] \(1+2) always referencing the same sv
>     
>     2484f8dbbb hid the fact that constant folding happens by making 1+2
>     fold to  a PADTMP, an SV that is never used as an lvalue and gets cop-
>     ied if one tries to use it that way.
>     
>     The PADTMP mechanism is what allows \"$x" to return a new value each
>     time, even though ops like "$x" actually reuse the same scalar repeat-
>     edly to return values.
>     
>     Because \ copies PADTMPs, \(1+2) ends up folding 1+2 to 3 (marked
>     PADTMP), which is then copied by the \ at compile time.  (Constant
>     folding works by evaluating certain ops at compile time and then
>     inlining their returned value.)  The result is that we have a folded
>     \3 where 3 is *not* marked PADTMP (the reference is, instead); hence
>     \(1+2) gives the same scalar each time, producing a value that can be
>     modified, affecting future evaluations.
>     
>     The solution is to skip folding \ if its argument is a PADTMP.
> 
> M	op.c
> M	t/comp/fold.t

This change appears to have introduced a warning being generated by
t/op/inccode.t:

ok 53 - returning PVBM doesn't segfault require
ok 54 - returning PVBM doesn't segfault use
Unquoted string "pm" may clash with future reserved word at /loader/0xd9aa80/foo.pm line 1.
ok 55 - returning PVBM ref doesn't segfault require
ok 56 - returning PVBM ref doesn't segfault use

The warning with threads is a bit different:

ok 54 - returning PVBM doesn't segfault use
Use of uninitialized value in require at (eval 16) line 2.
ok 55 - returning PVBM ref doesn't segfault require
Use of uninitialized value in require at (eval 17) line 2.
ok 56 - returning PVBM ref doesn't segfault use

This isn't occurring for me in the parent to that commit.

Tony

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