This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
error reporting of [$a ; $b] can be a TODO.
[perl5.git] / gv.c
diff --git a/gv.c b/gv.c
index 5eb09c2..da79403 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -602,6 +602,8 @@ S_gv_get_super_pkg(pTHX_ const char* name, I32 namelen)
 GV *
 Perl_gv_fetchmethod_autoload(pTHX_ HV *stash, const char *name, I32 autoload)
 {
+    PERL_ARGS_ASSERT_GV_FETCHMETHOD_AUTOLOAD;
+
     return gv_fetchmethod_flags(stash, name, autoload ? GV_AUTOLOAD : 0);
 }
 
@@ -620,10 +622,15 @@ Perl_gv_fetchmethod_flags(pTHX_ HV *stash, const char *name, U32 flags)
     const U32 autoload = flags & GV_AUTOLOAD;
     const U32 do_croak = flags & GV_CROAK;
 
-    PERL_ARGS_ASSERT_GV_FETCHMETHOD_AUTOLOAD;
+    PERL_ARGS_ASSERT_GV_FETCHMETHOD_FLAGS;
 
-    if (stash && SvTYPE(stash) < SVt_PVHV)
+    if (SvTYPE(stash) < SVt_PVHV)
        stash = NULL;
+    else {
+       /* The only way stash can become NULL later on is if nsplit is set,
+          which in turn means that there is no need for a SVt_PVHV case
+          the error reporting code.  */
+    }
 
     for (nend = name; *nend; nend++) {
        if (*nend == '\'') {
@@ -677,14 +684,9 @@ Perl_gv_fetchmethod_flags(pTHX_ HV *stash, const char *name, U32 flags)
                STRLEN packlen;
                const char *packname;
 
-               assert(error_report);
-
                if (nsplit) {
                    packlen = nsplit - origname;
                    packname = origname;
-               } else if (SvTYPE(error_report) == SVt_PVHV) {
-                   packlen = HvNAMELEN_get(error_report);
-                   packname = HvNAME_get(error_report);
                } else {
                    packname = SvPV_const(error_report, packlen);
                }