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

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

Thread Previous | Thread Next
February 2, 2012 10:51
Re: [perl #105906] Bleadperl d164302a breaks Lexical::Var underthreads+mad
Message ID:
Father Chrysostomos via RT wrote:
>As of commit d164302a58, the constant gets copied under threads+mad, so
>the 'no Lexical::Var' doesn't work, as \$foo is no longer returning a
>reference to the same scalar that Lexical::Var tried to make it return.

Sounds like it's more fundamentally broken if \$foo doesn't give a
consistent result.  I'll add that to the test suite.

>Then again, why does it need to be marked PADTMP?  If it's marked
>PADTMP, it means that taking a reference to it will copy it.  Isn't the
>readonliness sufficient?

Readonliness should be sufficient.  I think we can skip the copying in
that case.

>Why cannot XS modules create ops that return specific scalars?

They can, but it takes two ops: const yielding an RV, and rv2sv to get to
the specific scalar.  The RV can be pushed, shoved, copied, and so on,
without breaking the effect.  L:V does this in the non-readonly case.
Guess I'll have to extend that to the readonly case on problematic Perls,
but then it won't get to take part in constant folding.  Sigh.

>		&& cSVOPo->op_sv == &PL_sv_undef) {

Bah.  I'll have to special-case that.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About