From: "Vincent Pit" <perl@profvince.com>
Message-ID: <34395.147.210.17.175.
1207039697.squirrel@147.210.17.175>
p4raw-id: //depot/perl@33668
goto fix_gv;
default:
- SvGETMAGIC(sv);
if (SvROK(sv)) {
+ SvGETMAGIC(sv);
SV * const *sp = &sv; /* Used in tryAMAGICunDEREF macro. */
tryAMAGICunDEREF(to_cv);
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;