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

Re: [perl #105906] Bleadperl d164302a breaks Lexical::Var underthreads+mad

Thread Previous
From:
Zefram
Date:
February 3, 2012 06:48
Subject:
Re: [perl #105906] Bleadperl d164302a breaks Lexical::Var underthreads+mad
Message ID:
20120203144757.GA29183@lake.fysh.org
Father Chrysostomos via RT wrote:
>On Thu Feb 02 10:51:50 2012, zefram@fysh.org wrote:
>> Sounds like it's more fundamentally broken if \$foo doesn't give a
>> consistent result.  I'll add that to the test suite.
>
>The test suite is already testing for that,

Only by accident, and it only noticed when MAD made it worse.  I've now
got explicit tests for referential identity, which unpatched L:V fails on
any threading Perl (doesn't have to be MAD, doesn't have to be recent).
I've also now worked around the pad-related copying by a Cunning Artifice:
custom variant of the const op, which holds an RV (for which copying is
OK) referencing the object, rather than holding the object directly.
It's doing what the rv2sv+const combination (used for non-constant
variables) does, but packaged up in a way that constant folding is
willing to touch.

(Yeah, custom ops are my answer to everything.)

>Skip copying it when putting it in the pad (which I agree with), or in
>refgen (which would have controversial side-effects)?

When putting into the pad.  As I have a workaround, I suggest that we
leave this until 5.17, due to the risk of subtle breakage.

-zefram

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