summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 553f0015b9..a8b9dff79d 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2928,9 +2928,10 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
packname = Nullch;
if(SvOK(sv) && (packname = SvPV(sv, packlen))) {
- HE* he = hv_fetch_ent(PL_stashcache, sv, 0, 0);
+ HE* he;
+ he = hv_fetch_ent(PL_stashcache, sv, 0, 0);
if (he) {
- stash = (HV*)HeVAL(he);
+ stash = (HV*)SvIV(HeVAL(he));
goto fetch;
}
}
@@ -2956,10 +2957,9 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
if (!stash)
packsv = sv;
else {
- SvREFCNT_inc((SV*)stash);
- if(!hv_store(PL_stashcache, packname, packlen, (SV*)stash, 0))
- SvREFCNT_dec((SV*)stash);
- }
+ SV* ref = newSViv((IV)stash);
+ hv_store(PL_stashcache, packname, packlen, ref, 0);
+ }
goto fetch;
}
/* it _is_ a filehandle name -- replace with a reference */