diff options
author | David Mitchell <davem@iabyn.com> | 2010-07-18 18:18:50 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-07-18 18:39:18 +0100 |
commit | b3f91e9158d8a5c05627eba1c2848f35528571d2 (patch) | |
tree | 2a616b26bdf8d8d42ebdd6c8d05799853348c1e7 /sv.c | |
parent | c794ca97ff43be078aabf556aa282af208d9c38c (diff) | |
download | perl-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |