summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-07-18 18:18:50 +0100
committerDavid Mitchell <davem@iabyn.com>2010-07-18 18:39:18 +0100
commitb3f91e9158d8a5c05627eba1c2848f35528571d2 (patch)
tree2a616b26bdf8d8d42ebdd6c8d05799853348c1e7 /sv.c
parentc794ca97ff43be078aabf556aa282af208d9c38c (diff)
downloadperl-b3f91e9158d8a5c05627eba1c2848f35528571d2.tar.gz
add CvGV_set() macro and make CvGV() rvalue only
Now that CvGV can sometimes be reference counted, stop people from directly assigning to it (by using CvGV as an lvalue), and instead force them to use CvGV_set()
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index 1e756f2420..10e41a9c99 100644
--- a/sv.c
+++ b/sv.c
@@ -5675,7 +5675,7 @@ S_anonymise_cv_maybe(pTHX_ GV *gv, CV* cv)
/* will the CV shortly be freed by gp_free() ? */
if (GvCV(gv) == cv && GvGP(gv)->gp_refcnt < 2 && SvREFCNT(cv) < 2) {
- CvGV(cv) = NULL;
+ SvANY(cv)->xcv_gv = NULL;
return;
}
@@ -5688,7 +5688,7 @@ S_anonymise_cv_maybe(pTHX_ GV *gv, CV* cv)
CvANON_on(cv);
CvCVGV_RC_on(cv);
- CvGV(cv) = MUTABLE_GV(SvREFCNT_inc(anongv));
+ SvANY(cv)->xcv_gv = MUTABLE_GV(SvREFCNT_inc(anongv));
}
@@ -11438,7 +11438,7 @@ S_sv_dup_common(pTHX_ const SV *const sstr, CLONE_PARAMS *const param)
}
/* don't dup if copying back - CvGV isn't refcounted, so the
* duped GV may never be freed. A bit of a hack! DAPM */
- CvGV(dstr) =
+ SvANY(MUTABLE_CV(dstr))->xcv_gv =
CvCVGV_RC(dstr)
? gv_dup_inc(CvGV(sstr), param)
: (param->flags & CLONEf_JOIN_IN)