diff options
author | David Mitchell <davem@iabyn.com> | 2010-07-18 16:21:03 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-07-18 18:39:18 +0100 |
commit | c794ca97ff43be078aabf556aa282af208d9c38c (patch) | |
tree | b64762c446394bee68df369d68966f9b15452c60 /pad.c | |
parent | cfc1e951d98ba2b9a0e066aba9aadba4cd919eec (diff) | |
download | perl-c794ca97ff43be078aabf556aa282af208d9c38c.tar.gz |
change when to make CvGV refcounted
Rather than making CvGV refcounted if the CV is anon, decide based on
whether the GV pointed to by CvGV holds a reference back to us. Normally
these two will be equivalent, but this way is more robust if people are
doing weird things.
Also spotted an error with cv_clone not clearing the CVf_CVGV_RC flag on
the newly cloned cv. This shouldn't normally matter as it will get set
shortly anyway, but best to keep things logically correct.
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1562,7 +1562,7 @@ Perl_cv_clone(pTHX_ CV *proto) SAVESPTR(PL_compcv); cv = PL_compcv = MUTABLE_CV(newSV_type(SvTYPE(proto))); - CvFLAGS(cv) = CvFLAGS(proto) & ~(CVf_CLONE|CVf_WEAKOUTSIDE); + CvFLAGS(cv) = CvFLAGS(proto) & ~(CVf_CLONE|CVf_WEAKOUTSIDE|CVf_CVGV_RC); CvCLONED_on(cv); #ifdef USE_ITHREADS |