Make PerlIO::encoding handle cows
authorFather Chrysostomos <sprout@cpan.org>
Tue, 16 Oct 2012 06:06:31 +0000 (23:06 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 16 Oct 2012 06:06:31 +0000 (23:06 -0700)
commit8f79eb5b229ed80688d6f2b3bfed18e5e48ad29a
tree597566bdc29cb6021d568e74e2e02ccfd2cd6114
parentbc1df6c26399cfc1a6171e049edcc6a5a21de2a6
Make PerlIO::encoding handle cows

Commits 667763bdbf and e9a8753af fixed bugs involving buffer realloca-
tions during encode and decode.  But what was not taken into account
was that the COW flags could still be left on even when buffer real-
ocations were accounted for.  This could result in SvPV_set and
SvLEN_set(sv,0) being called on an SV with the COW flags still on,
so SvPVX would be treated as a key inside a shared_he, resulting in
assertion failures.
ext/PerlIO-encoding/encoding.xs
ext/PerlIO-encoding/t/encoding.t