This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
op.c:ck_svconst: Don’t allow ro COWs under old COW
Under PERL_OLD_COPY_ON_WRITE, allowing COWs to become read-only will
complicate things elsewhere. It uses the IV slot of an SV to point
to a loop of SVs sharing the same buffer. sv_2iv cannot cache the IV
without running the SV through sv_force_normal, but that will croak on
read-only values. I could change it to S_sv_uncow, but there are more
cases elsewhere that would have to be audited, I don’t think it’s
worth spending time on improving PERL_OLD_COPY_ON_WRITE as it’s ‘dead
code, never intended to go live’ according to its author. I am
bothering with at least this much because I don’t want to break it
knowingly.