summaryrefslogtreecommitdiff
path: root/cv.h
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2010-10-25 23:34:23 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-10-25 17:45:14 -0700
commitc68d956458c78806cbdba85dfe23247f62e143d5 (patch)
treec61fbddcbc0d54a524e6ae2c5c1b4a65a60319b3 /cv.h
parent3ba4b5c12a24a4d2dd2388527109b05429b3565c (diff)
downloadperl-c68d956458c78806cbdba85dfe23247f62e143d5.tar.gz
add CvSTASH_set() macro and make CvSTASH() rvalue only
Now that CvSTASH requires backreference bookkeeping, stop people from directly assigning to it (by using CvSTASH() as an lvalue), and instead force them to use CvSTASH_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 e6f5cba9c6..6fdf5cbaf2 100644
--- a/cv.h
+++ b/cv.h
@@ -36,7 +36,8 @@ Returns the stash of the CV.
# define Nullcv Null(CV*)
#endif
-#define CvSTASH(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_stash
+#define CvSTASH(sv) (0+((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_stash)
+#define CvSTASH_set(cv,st) Perl_cvstash_set(aTHX_ cv, st)
#define CvSTART(sv) ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_start_u.xcv_start
#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