summaryrefslogtreecommitdiff
path: root/gv.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 /gv.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 'gv.c')
-rw-r--r--gv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 917cfb7ee9..a5c33d93f1 100644
--- a/gv.c
+++ b/gv.c
@@ -215,7 +215,7 @@ Perl_cvgv_set(pTHX_ CV* cv, GV* gv)
}
}
- CvGV(cv) = gv;
+ SvANY(cv)->xcv_gv = gv;
assert(!CvCVGV_RC(cv));
if (!gv)
@@ -303,7 +303,7 @@ Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi)
LEAVE;
mro_method_changed_in(GvSTASH(gv)); /* sub Foo::bar($) { (shift) } sub ASDF::baz($); *ASDF::baz = \&Foo::bar */
- cvgv_set(cv, gv);
+ CvGV_set(cv, gv);
CvFILE_set_from_cop(cv, PL_curcop);
CvSTASH(cv) = PL_curstash;
if (PL_curstash)