Fix sub call through magic var (e.g. C<&$1>)
Chip Salzenberg [Mon, 10 Feb 1997 22:11:59 +0000 (10:11 +1200)]
pp_hot.c

index 16c2505..44981b7 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1706,9 +1706,14 @@ PP(pp_entersub)
 
            if (sv == &sv_yes)          /* unfound import, ignore */
                RETURN;
-           if (!SvOK(sv))
+           if (SvGMAGICAL(sv)) {
+               mg_get(sv);
+               sym = SvPOKp(sv) ? SvPVX(sv) : Nullch;
+           }
+           else
+               sym = SvPV(sv, na);
+           if (!sym)
                DIE(no_usym, "a subroutine");
-           sym = SvPV(sv,na);
            if (op->op_private & HINT_STRICT_REFS)
                DIE(no_symref, sym, "a subroutine");
            cv = perl_get_cv(sym, TRUE);