summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gv.c5
-rw-r--r--pp_hot.c14
2 files changed, 17 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 241e6167b6..a9eb65a853 100644
--- a/gv.c
+++ b/gv.c
@@ -564,7 +564,12 @@ S_gv_get_super_pkg(pTHX_ const char* name, I32 namelen)
superisa = GvAVn(gv);
GvMULTI_on(gv);
sv_magic((SV*)superisa, (SV*)gv, PERL_MAGIC_isa, NULL, 0);
+#ifdef USE_ITHREADS
av_push(superisa, newSVpv(CopSTASHPV(PL_curcop), 0));
+#else
+ av_push(superisa, newSVhek(CopSTASH(PL_curcop)
+ ? HvNAME_HEK(CopSTASH(PL_curcop)) : NULL));
+#endif
return stash;
}
diff --git a/pp_hot.c b/pp_hot.c
index 6fb53d49a4..423c4c8e76 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -3097,16 +3097,24 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
}
if (!sep || ((sep - name) == 5 && strnEQ(name, "SUPER", 5))) {
/* the method name is unqualified or starts with SUPER:: */
+#ifndef USE_ITHREADS
+ if (sep)
+ stash = CopSTASH(PL_curcop);
+#else
bool need_strlen = 1;
if (sep) {
packname = CopSTASHPV(PL_curcop);
}
- else if (stash) {
+ else
+#endif
+ if (stash) {
HEK * const packhek = HvNAME_HEK(stash);
if (packhek) {
packname = HEK_KEY(packhek);
packlen = HEK_LEN(packhek);
+#ifdef USE_ITHREADS
need_strlen = 0;
+#endif
} else {
goto croak;
}
@@ -3117,8 +3125,10 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
Perl_croak(aTHX_
"Can't use anonymous symbol table for method lookup");
}
- else if (need_strlen)
+#ifdef USE_ITHREADS
+ if (need_strlen)
packlen = strlen(packname);
+#endif
}
else {