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

[PATCH] Re: [perl #19135] string eval turns off readonlyness on lexicals

From:
Father Chrysostomos
Date:
September 19, 2010 12:09
Subject:
[PATCH] Re: [perl #19135] string eval turns off readonlyness on lexicals
Message ID:
5D69B8D1-F264-4D55-AAF6-AA14C0B55EBE@cpan.org
The readonliness is turned off explicitly in pad_free under ithreads. See also bug #19022, which resulted from the same change. There is some discussion there, too, but nobody seemed to know exactly why the readonliness needed to be turned off.

Change 4761/2aa1bed, from January of 2000, added that SvREADONLY_off. It is supposed to make sure that pad entries that were constants will not be constants the next time they are used.

My question is: When the addresses of those scalars are reused, won’t the scalars be wiped clean? (In case it’s not obvious, I have very little idea how pads actually work.)

I tried simply deleting that SvREADONLY_off, and all tests pass (see the first attached patch).

Then I thought that maybe I should check that the SV is freed, and only then do SvREADONLY_off, to preserve the original intent of change 4761/2aa1bed. That worked too.

So, here are two patches. Take your pick.



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About