summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-19 22:15:52 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-20 07:43:24 -0700
commit5988f3061bb4e71b2048c7b82f098bfa943a07d7 (patch)
treeefab5dfbf2ae6da901391ce83f61f14e236866f1 /gv.c
parent365c7d0c5cb1cae07e9bacec13b5debcd4ead9eb (diff)
downloadperl-5988f3061bb4e71b2048c7b82f098bfa943a07d7.tar.gz
[perl #122799] Always turn off CvNAMED in cvgv-set
Instead of turning off the flag only when we need to turn it off (when there is a hek, which is the only time it should be on), just turn it off unconditionally. This gets Scope::Upper working once more. While it is arguably the module’s fault, it’s still a good idea to make cvgv_set robust. CvNAMED should never be on after calling it, regardless of the previous state of the CV.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index 73fb7daec9..04013a522e 100644
--- a/gv.c
+++ b/gv.c
@@ -234,10 +234,10 @@ Perl_cvgv_set(pTHX_ CV* cv, GV* gv)
}
else if ((hek = CvNAME_HEK(cv))) {
unshare_hek(hek);
- CvNAMED_off(cv);
CvLEXICAL_off(cv);
}
+ CvNAMED_off(cv);
SvANY(cv)->xcv_gv_u.xcv_gv = gv;
assert(!CvCVGV_RC(cv));