summaryrefslogtreecommitdiff
path: root/cv.h
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 /cv.h
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 'cv.h')
-rw-r--r--cv.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/cv.h b/cv.h
index d762a062cf..7979a05c80 100644
--- a/cv.h
+++ b/cv.h
@@ -41,7 +41,8 @@ Returns the stash of the CV.
#define CvROOT(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_root_u.xcv_root
#define CvXSUB(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_root_u.xcv_xsub
#define CvXSUBANY(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_start_u.xcv_xsubany
-#define CvGV(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv
+#define CvGV(sv) (0+((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv)
+#define CvGV_set(cv,gv) Perl_cvgv_set(aTHX_ cv, gv)
#define CvFILE(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_file
#ifdef USE_ITHREADS
# define CvFILE_set_from_cop(sv, cop) (CvFILE(sv) = savepv(CopFILE(cop)))