From: Vincent Pit Date: Tue, 1 Apr 2008 10:48:17 +0000 (+0200) Subject: Double magic with '\&$x' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9d0f7ed7530aacfa94e94c3784145f348ffa6be9;p=p5sagit%2Fp5-mst-13.2.git Double magic with '\&$x' From: "Vincent Pit" Message-ID: <34395.147.210.17.175.1207039697.squirrel@147.210.17.175> p4raw-id: //depot/perl@33668 --- diff --git a/sv.c b/sv.c index 96ef7c8..f9546e1 100644 --- a/sv.c +++ b/sv.c @@ -7872,8 +7872,8 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **const st, GV **const gvp, const I32 lref) goto fix_gv; default: - SvGETMAGIC(sv); if (SvROK(sv)) { + SvGETMAGIC(sv); SV * const *sp = &sv; /* Used in tryAMAGICunDEREF macro. */ tryAMAGICunDEREF(to_cv); @@ -7889,10 +7889,12 @@ Perl_sv_2cv(pTHX_ SV *sv, HV **const st, GV **const gvp, const I32 lref) else Perl_croak(aTHX_ "Not a subroutine reference"); } - else if (isGV(sv)) + else if (isGV(sv)) { + SvGETMAGIC(sv); gv = (GV*)sv; + } else - gv = gv_fetchsv(sv, lref, SVt_PVCV); + gv = gv_fetchsv(sv, lref, SVt_PVCV); /* Calls get magic */ *gvp = gv; if (!gv) { *st = NULL;