summaryrefslogtreecommitdiff
path: root/pad.c
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 /pad.c
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 'pad.c')
-rw-r--r--pad.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pad.c b/pad.c
index e945113a4a..d395e71dfe 100644
--- a/pad.c
+++ b/pad.c
@@ -1573,9 +1573,7 @@ Perl_cv_clone(pTHX_ CV *proto)
CvFILE(cv) = CvFILE(proto);
#endif
CvGV_set(cv,CvGV(proto));
- CvSTASH(cv) = CvSTASH(proto);
- if (CvSTASH(cv))
- Perl_sv_add_backref(aTHX_ MUTABLE_SV(CvSTASH(cv)), MUTABLE_SV(cv));
+ CvSTASH_set(cv, CvSTASH(proto));
OP_REFCNT_LOCK;
CvROOT(cv) = OpREFCNT_inc(CvROOT(proto));
OP_REFCNT_UNLOCK;