This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The lref argument of sv_2cv is actually passed onwards to gv_fetchsv,
authorNicholas Clark <nick@ccl4.org>
Wed, 21 Dec 2005 18:34:03 +0000 (18:34 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 21 Dec 2005 18:34:03 +0000 (18:34 +0000)
so it is a bitmap of flag bits rather than simple TRUE/FALSE.

p4raw-id: //depot/perl@26434

mg.c
pp.c
pp_hot.c
sv.c

diff --git a/mg.c b/mg.c
index 0857395..0722f44 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -2664,7 +2664,7 @@ Perl_sighandler(int sig)
     if (!SvROK(PL_psig_ptr[sig]) || !(cv = (CV*)SvRV(PL_psig_ptr[sig]))
        || SvTYPE(cv) != SVt_PVCV) {
        HV *st;
-       cv = sv_2cv(PL_psig_ptr[sig],&st,&gv,TRUE);
+       cv = sv_2cv(PL_psig_ptr[sig], &st, &gv, GV_ADD);
     }
 
     if (!cv || !CvROOT(cv)) {
diff --git a/pp.c b/pp.c
index 9e87306..ae893bc 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -340,7 +340,8 @@ PP(pp_rv2cv)
 
     /* We usually try to add a non-existent subroutine in case of AUTOLOAD. */
     /* (But not in defined().) */
-    CV *cv = sv_2cv(TOPs, &stash, &gv, !(PL_op->op_flags & OPf_SPECIAL));
+    CV *cv = sv_2cv(TOPs, &stash, &gv,
+                   (PL_op->op_flags & OPf_SPECIAL) ? 0 : GV_ADD);
     if (cv) {
        if (CvCLONE(cv))
            cv = (CV*)sv_2mortal((SV*)cv_clone(cv));
@@ -416,7 +417,7 @@ PP(pp_prototype)
            }
        }
     }
-    cv = sv_2cv(TOPs, &stash, &gv, FALSE);
+    cv = sv_2cv(TOPs, &stash, &gv, 0);
     if (cv && SvPOK(cv))
        ret = sv_2mortal(newSVpvn(SvPVX_const(cv), SvCUR(cv)));
   set:
@@ -3809,7 +3810,7 @@ PP(pp_exists)
     if (PL_op->op_private & OPpEXISTS_SUB) {
        GV *gv;
        SV * const sv = POPs;
-       CV * const cv = sv_2cv(sv, &hv, &gv, FALSE);
+       CV * const cv = sv_2cv(sv, &hv, &gv, 0);
        if (cv)
            RETPUSHYES;
        if (gv && isGV(gv) && GvCV(gv) && !GvCVGEN(gv))
index f9a0a9f..6f6cb24 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2622,7 +2622,7 @@ PP(pp_entersub)
        /* This is overwhelming the most common case:  */
     case SVt_PVGV:
        if (!(cv = GvCVu((GV*)sv)))
-           cv = sv_2cv(sv, &stash, &gv, FALSE);
+           cv = sv_2cv(sv, &stash, &gv, 0);
        if (!cv) {
            ENTER;
            SAVETMPS;
diff --git a/sv.c b/sv.c
index 0009471..a6f0866 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -6721,6 +6721,7 @@ Perl_sv_2io(pTHX_ SV *sv)
 
 Using various gambits, try to get a CV from an SV; in addition, try if
 possible to set C<*st> and C<*gvp> to the stash and GV associated with it.
+The flags in C<lref> are passed to sv_fetchsv.
 
 =cut
 */