From: Chip Salzenberg Date: Mon, 10 Feb 1997 22:11:59 +0000 (+1200) Subject: Fix sub call through magic var (e.g. C<&$1>) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15ff848f77796a7eb1aa7d49b2bc68dd9e9c24f9;p=p5sagit%2Fp5-mst-13.2.git Fix sub call through magic var (e.g. C<&$1>) --- diff --git a/pp_hot.c b/pp_hot.c index 16c2505..44981b7 100644 --- 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);