Make OLD_COPY_ON_WRITE handle SvLEN==0 scalars
authorFather Chrysostomos <sprout@cpan.org>
Sun, 11 Aug 2013 06:30:33 +0000 (23:30 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 11 Aug 2013 14:41:25 +0000 (07:41 -0700)
commit1039c1e20a84cb25476db77150e33465c88839cf
treefd449f14b32784c1e578c8d4237dc2db231f3482
parent1620522e445f07dfded3e2bd7051de7349c2ee3e
Make OLD_COPY_ON_WRITE handle SvLEN==0 scalars

SvLEN==0 means the scalar does not own the buffer.

PERL_OLD_COPY_ON_WRITE can’t do its copy-on-write with those, as
SvIsCOW && SvLEN==0 means a shared hash key scalar.

PerlIO::encoding passes such scalars to the Encode object’s
encode method.

Why am I even fixing this?  I was trying to make sure that I wasn’t
breaking PERL_OLD_COPY_ON_WRITE with other changes.  I got assertion
failures from encoding.t so I looked to see what the problem might be,
thinking it could affect other configurations.  It turns out not to be
specific to PERL_OLD_COPY_ON_WRITE, but since I have found the problem
I might as well fix it anyway.
sv.c