diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-07 08:12:27 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-11 07:41:26 -0700 |
commit | 9ff3e6d8e1976c0d05c130c992864d16ab35ce39 (patch) | |
tree | 103be9cb3440765e7bba2ffde83f0552f3052028 /mg.c | |
parent | 3805b5fb04f8819edfb6bd5256d5eefd7b23e730 (diff) | |
download | perl-9ff3e6d8e1976c0d05c130c992864d16ab35ce39.tar.gz |
Remove SvIsCOW checks from mg.c:mg_localize
It no longer needs to worry about SvIsCOW. This logic is left over
from when READONLY+FAKE was used for COWs.
Since it is possible for COWs to be read-only now, this logic is actu-
ally faulty, as it doesn’t temporarily stop read-only COWs from being
read-only, as it does for other read-only values.
This actually causes discrepancies with scalar-tied locked hash keys,
which differ in readonliness when localised depending on whether the previous value used copy-on-write.
Whether such scalars should be read-only after localisation is open
to debate, but it should not differ based on the means of storing the
previous value.
Diffstat (limited to 'mg.c')
-rw-r--r-- | mg.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -526,7 +526,7 @@ Perl_mg_localize(pTHX_ SV *sv, SV *nsv, bool setmagic) mg->mg_ptr, mg->mg_len); /* container types should remain read-only across localization */ - if (!SvIsCOW(sv)) SvFLAGS(nsv) |= SvREADONLY(sv); + SvFLAGS(nsv) |= SvREADONLY(sv); } if (SvTYPE(nsv) >= SVt_PVMG && SvMAGIC(nsv)) { |