This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove SvIsCOW checks from mg.c:mg_localize
authorFather Chrysostomos <sprout@cpan.org>
Wed, 7 Aug 2013 15:12:27 +0000 (08:12 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 11 Aug 2013 14:41:26 +0000 (07:41 -0700)
commit9ff3e6d8e1976c0d05c130c992864d16ab35ce39
tree103be9cb3440765e7bba2ffde83f0552f3052028
parent3805b5fb04f8819edfb6bd5256d5eefd7b23e730
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.
mg.c
t/op/tie.t