diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-09-26 13:48:52 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:08 -0700 |
commit | 1bac5ecc108e6bb05752e5aef66c6890163aff39 (patch) | |
tree | 047d2e8ef659d5705e2c2eafe65dff3829b994fc /sv.c | |
parent | a15456ded8f3d1fb2d67e9e3027b5766cc1c419f (diff) | |
download | perl-1bac5ecc108e6bb05752e5aef66c6890163aff39.tar.gz |
sv.c: S_anonymise_cv_maybe UTF8 cleanup.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -5893,7 +5893,6 @@ Perl_sv_replace(pTHX_ register SV *const sv, register SV *const nsv) STATIC void S_anonymise_cv_maybe(pTHX_ GV *gv, CV* cv) { - char *stash; SV *gvname; GV *anongv; @@ -5913,10 +5912,10 @@ S_anonymise_cv_maybe(pTHX_ GV *gv, CV* cv) } /* if not, anonymise: */ - stash = GvSTASH(gv) && HvNAME(GvSTASH(gv)) - ? HvENAME(GvSTASH(gv)) : NULL; - gvname = Perl_newSVpvf(aTHX_ "%s::__ANON__", - stash ? stash : "__ANON__"); + gvname = (GvSTASH(gv) && HvNAME(GvSTASH(gv)) && HvENAME(GvSTASH(gv))) + ? newSVhek(HvENAME_HEK(GvSTASH(gv))) + : newSVpvn_flags( "__ANON__", 8, 0 ); + sv_catpvs(gvname, "::__ANON__"); anongv = gv_fetchsv(gvname, GV_ADDMULTI, SVt_PVCV); SvREFCNT_dec(gvname); |