diff options
author | Vincent Pit <perl@profvince.com> | 2008-04-01 12:48:17 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2008-04-11 12:32:09 +0000 |
commit | 9d0f7ed7530aacfa94e94c3784145f348ffa6be9 (patch) | |
tree | 8f3199225eb0e97cde026487cabc34eabd2a7aa1 | |
parent | 89c6a13e141e02cc3af670ab47c1d41ac4e81ba0 (diff) | |
download | perl-9d0f7ed7530aacfa94e94c3784145f348ffa6be9.tar.gz |
Double magic with '\&$x'
From: "Vincent Pit" <perl@profvince.com>
Message-ID: <34395.147.210.17.175.1207039697.squirrel@147.210.17.175>
p4raw-id: //depot/perl@33668
-rw-r--r-- | sv.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; |