[perl #36037] Perl 5.8.7-RC1 build problems on LynxOS
[p5sagit/p5-mst-13.2.git] / pp_hot.c
index 1f9abc3..f829f49 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2690,8 +2690,6 @@ PP(pp_entersub)
        if (hasargs)
        {
            AV* av;
-           SV** ary;
-
 #if 0
            DEBUG_S(PerlIO_printf(Perl_debug_log,
                                  "%p entersub preparing @_\n", thr));
@@ -2711,7 +2709,7 @@ PP(pp_entersub)
            ++MARK;
 
            if (items > AvMAX(av) + 1) {
-               ary = AvALLOC(av);
+               SV **ary = AvALLOC(av);
                if (AvARRAY(av) != ary) {
                    AvMAX(av) += AvARRAY(av) - AvALLOC(av);
                    SvPV_set(av, (char*)ary);
@@ -3087,14 +3085,30 @@ S_method_common(pTHX_ SV* meth, U32* hashp)
                sep = p, leaf = p + 2;
        }
        if (!sep || ((sep - name) == 5 && strnEQ(name, "SUPER", 5))) {
-           /* the method name is unqualified or starts with SUPER:: */ 
-           packname = sep ? CopSTASHPV(PL_curcop) :
-               stash ? HvNAME_get(stash) : packname;
-           if (!packname)
+           /* the method name is unqualified or starts with SUPER:: */
+           bool need_strlen = 1;
+           if (sep) {
+               packname = CopSTASHPV(PL_curcop);
+           }
+           else if (stash) {
+               HEK *packhek = HvNAME_HEK(stash);
+               if (packhek) {
+                   packname = HEK_KEY(packhek);
+                   packlen = HEK_LEN(packhek);
+                   need_strlen = 0;
+               } else {
+                   goto croak;
+               }
+           }
+
+           if (!packname) {
+           croak:
                Perl_croak(aTHX_
                           "Can't use anonymous symbol table for method lookup");
-           else
+           }
+           else if (need_strlen)
                packlen = strlen(packname);
+
        }
        else {
            /* the method name is qualified */