#if defined(PERL_IN_HV_C) || defined(PERL_DECL_PROT)
s |void |hsplit |NN HV *hv
s |void |hfreeentries |NN HV *hv
-s |I32 |anonymise_cv |NULLOK const char *stash|NN SV *val
+s |I32 |anonymise_cv |NULLOK HEK *stash|NN SV *val
sa |HE* |new_he
sanR |HEK* |save_hek_flags |NN const char *str|I32 len|U32 hash|int flags
sn |void |hv_magic_check |NN HV *hv|NN bool *needs_copy|NN bool *needs_store
if (!entry)
return;
val = HeVAL(entry);
- if (HvNAME(hv) && anonymise_cv(HvNAME(hv), val) && GvCVu(val))
+ if (HvNAME(hv) && anonymise_cv(HvNAME_HEK(hv), val) && GvCVu(val))
mro_method_changed_in(hv);
SvREFCNT_dec(val);
if (HeKLEN(entry) == HEf_SVKEY) {
}
static I32
-S_anonymise_cv(pTHX_ const char *stash, SV *val)
+S_anonymise_cv(pTHX_ HEK *stash, SV *val)
{
CV *cv;
if (val && isGV(val) && isGV_with_GP(val) && (cv = GvCV(val))) {
if ((SV *)CvGV(cv) == val) {
- SV *gvname;
GV *anongv;
- gvname = Perl_newSVpvf(aTHX_ "%s::__ANON__", stash ? stash : "__ANON__");
- anongv = gv_fetchsv(gvname, GV_ADDMULTI, SVt_PVCV);
- SvREFCNT_dec(gvname);
+ if (stash) {
+ SV *gvname = newSVhek(stash);
+ sv_catpvs(gvname, "::__ANON__");
+ anongv = gv_fetchsv(gvname, GV_ADDMULTI, SVt_PVCV);
+ SvREFCNT_dec(gvname);
+ } else {
+ anongv = gv_fetchpvs("__ANON__::__ANON__", GV_ADDMULTI,
+ SVt_PVCV);
+ }
CvGV(cv) = anongv;
CvANON_on(cv);
return 1;
#define PERL_ARGS_ASSERT_HFREEENTRIES \
assert(hv)
-STATIC I32 S_anonymise_cv(pTHX_ const char *stash, SV *val)
+STATIC I32 S_anonymise_cv(pTHX_ HEK *stash, SV *val)
__attribute__nonnull__(pTHX_2);
#define PERL_ARGS_ASSERT_ANONYMISE_CV \
assert(val)