This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
sv.c: Don’t flip flags so many times in glob_assign_glob
authorFather Chrysostomos <sprout@cpan.org>
Thu, 13 Feb 2014 22:32:22 +0000 (14:32 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 15 Feb 2014 15:01:39 +0000 (07:01 -0800)
commit0898f5857e7682c97f9d3fa8d4273eca2b3a7804
treecc9f4566a44c6df0307b7141bde1a60437be2864
parentbb5e6740edccf2703e0d7b006c0674a289d48888
sv.c: Don’t flip flags so many times in glob_assign_glob

We only need to turn off the SvOK flags when the destination was not
already a glob.

Up till now, the code was doing SvOK_off twice, and
isGV_with_GP_on/off several times to avoid assertion failures.

If we already have a glob, then the only SvOK flags that can be on
already are SVpgv_GP (which needs to be on) and possibly SVf_UTF8,
which is harmless.

The only difference is that now the dumped glob in this one-liner will
have its UTF8 flag set:

$ ./perl -Ilib -MDevel::Peek -e 'use utf8; "".*φου; *φου = *bar; Dump *φου'

whereas it didn’t before.  That is of no consequence, as the UTF8 flag
is only meaningful after stringification, which resets it.
sv.c