summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Pit <perl@profvince.com>2008-04-01 12:48:17 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-04-11 12:32:09 +0000
commit9d0f7ed7530aacfa94e94c3784145f348ffa6be9 (patch)
tree8f3199225eb0e97cde026487cabc34eabd2a7aa1
parent89c6a13e141e02cc3af670ab47c1d41ac4e81ba0 (diff)
downloadperl-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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index 96ef7c8340..f9546e11a9 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;