This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #114410] Reset utf8 pos cache on get
authorFather Chrysostomos <sprout@cpan.org>
Fri, 31 Aug 2012 01:01:27 +0000 (18:01 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 31 Aug 2012 01:18:13 +0000 (18:18 -0700)
commit7d1328bb7c26d556809b1aed184cec377b18f20c
tree8b5067a3cef208222fda2304bf74c884f6bb8f8e
parent4785469e43ed59eb07455c31ce1079ada2c9f91f
[perl #114410] Reset utf8 pos cache on get

If a scalar is gmagical, then the string buffer could change without
the utf8 pos cache being updated.

So it should respond to get-magic, not just set-magic.  Actually add-
ing get-magic to the utf8 magic vtable would cause all scalars with
this magic to be flagged gmagical.  Instead, in magic_get, we can call
magic_setutf8.
mg.c
t/op/utf8cache.t