summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c5
-rw-r--r--hv.c3
-rw-r--r--hv.h2
-rw-r--r--mro.c2
-rw-r--r--sv.c1
5 files changed, 7 insertions, 6 deletions
diff --git a/gv.c b/gv.c
index 13bcbbfba6..5702e5e9a7 100644
--- a/gv.c
+++ b/gv.c
@@ -681,8 +681,9 @@ Perl_gv_fetchmeth_pvn(pTHX_ HV *stash, const char *name, STRLEN len, I32 level,
topgen_cmp = HvMROMETA(stash)->cache_gen + PL_sub_generation;
if (flags & GV_SUPER) {
- if (!HvAUX(stash)->xhv_super) HvAUX(stash)->xhv_super = newHV();
- cachestash = HvAUX(stash)->xhv_super;
+ if (!HvAUX(stash)->xhv_mro_meta->super)
+ HvAUX(stash)->xhv_mro_meta->super = newHV();
+ cachestash = HvAUX(stash)->xhv_mro_meta->super;
}
else cachestash = stash;
diff --git a/hv.c b/hv.c
index 02fe607cfd..07837ab991 100644
--- a/hv.c
+++ b/hv.c
@@ -1827,10 +1827,10 @@ Perl_hv_undef_flags(pTHX_ HV *hv, U32 flags)
SvREFCNT_dec(meta->mro_linear_current);
SvREFCNT_dec(meta->mro_nextmethod);
SvREFCNT_dec(meta->isa);
+ SvREFCNT_dec(meta->super);
Safefree(meta);
aux->xhv_mro_meta = NULL;
}
- SvREFCNT_dec(aux->xhv_super);
if (!aux->xhv_name_u.xhvnameu_name && ! aux->xhv_backreferences)
SvFLAGS(hv) &= ~SVf_OOK;
}
@@ -1982,7 +1982,6 @@ S_hv_auxinit(pTHX_ HV *hv) {
iter->xhv_name_count = 0;
iter->xhv_backreferences = 0;
iter->xhv_mro_meta = NULL;
- iter->xhv_super = NULL;
return iter;
}
diff --git a/hv.h b/hv.h
index 47432e34ba..920fd99760 100644
--- a/hv.h
+++ b/hv.h
@@ -81,6 +81,7 @@ struct mro_meta {
U32 pkg_gen; /* Bumps when local methods/@ISA change */
const struct mro_alg *mro_which; /* which mro alg is in use? */
HV *isa; /* Everything this class @ISA */
+ HV *super; /* SUPER method cache */
U32 destroy_gen; /* Generation number of DESTROY cache */
};
@@ -112,7 +113,6 @@ struct xpvhv_aux {
*/
I32 xhv_name_count;
struct mro_meta *xhv_mro_meta;
- HV * xhv_super; /* SUPER method cache */
#ifdef PERL_HASH_RANDOMIZE_KEYS
U32 xhv_rand; /* random value for hash traversal */
U32 xhv_last_rand; /* last random value for hash traversal,
diff --git a/mro.c b/mro.c
index cb679503a4..2ce9fa2da3 100644
--- a/mro.c
+++ b/mro.c
@@ -186,6 +186,8 @@ Perl_mro_meta_dup(pTHX_ struct mro_meta* smeta, CLONE_PARAMS* param)
newmeta->isa
= MUTABLE_HV(sv_dup_inc((const SV *)newmeta->isa, param));
+ newmeta->super = NULL;
+
return newmeta;
}
diff --git a/sv.c b/sv.c
index ea96a049f8..6b858def38 100644
--- a/sv.c
+++ b/sv.c
@@ -12518,7 +12518,6 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
daux->xhv_mro_meta = saux->xhv_mro_meta
? mro_meta_dup(saux->xhv_mro_meta, param)
: 0;
- daux->xhv_super = NULL;
/* Record stashes for possible cloning in Perl_clone(). */
if (HvNAME(sstr))