diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-02-13 14:32:22 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-02-15 07:01:39 -0800 |
commit | 0898f5857e7682c97f9d3fa8d4273eca2b3a7804 (patch) | |
tree | cc9f4566a44c6df0307b7141bde1a60437be2864 /sv.c | |
parent | bb5e6740edccf2703e0d7b006c0674a289d48888 (diff) | |
download | perl-0898f5857e7682c97f9d3fa8d4273eca2b3a7804.tar.gz |
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.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 5 |
1 files changed, 0 insertions, 5 deletions
@@ -3713,8 +3713,6 @@ S_glob_assign_glob(pTHX_ SV *const dstr, SV *const sstr, const int dtype) } SvUPGRADE(dstr, SVt_PVGV); (void)SvOK_off(dstr); - /* We have to turn this on here, even though we turn it off - below, as GvSTASH will fail an assertion otherwise. */ isGV_with_GP_on(dstr); } GvSTASH(dstr) = GvSTASH(sstr); @@ -3778,9 +3776,6 @@ S_glob_assign_glob(pTHX_ SV *const dstr, SV *const sstr, const int dtype) } gp_free(MUTABLE_GV(dstr)); - isGV_with_GP_off(dstr); /* SvOK_off does not like globs. */ - (void)SvOK_off(dstr); - isGV_with_GP_on(dstr); GvINTRO_off(dstr); /* one-shot flag */ GvGP_set(dstr, gp_ref(GvGP(sstr))); if (SvTAINTED(sstr)) |