summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2011-09-26 13:48:52 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-10-06 13:01:08 -0700
commit1bac5ecc108e6bb05752e5aef66c6890163aff39 (patch)
tree047d2e8ef659d5705e2c2eafe65dff3829b994fc /sv.c
parenta15456ded8f3d1fb2d67e9e3027b5766cc1c419f (diff)
downloadperl-1bac5ecc108e6bb05752e5aef66c6890163aff39.tar.gz
sv.c: S_anonymise_cv_maybe UTF8 cleanup.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index d71f901d76..a3a2c74a49 100644
--- a/sv.c
+++ b/sv.c
@@ -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);