diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-07-07 17:35:10 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-09-15 22:44:59 -0700 |
commit | b290562ef436d5316a2f75513def7f4f18c4ef34 (patch) | |
tree | cf17255810711fb72c2702959076b99265b56068 /gv.c | |
parent | 97b03d64e557578d3dbfeb6e6ca37ba57d57e858 (diff) | |
download | perl-b290562ef436d5316a2f75513def7f4f18c4ef34.tar.gz |
Allow CVs to point to HEKs rather than GVs
This will allow named lexical subs to exist independent of GVs.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -207,6 +207,7 @@ void Perl_cvgv_set(pTHX_ CV* cv, GV* gv) { GV * const oldgv = CvGV(cv); + HEK *hek; PERL_ARGS_ASSERT_CVGV_SET; if (oldgv == gv) @@ -221,8 +222,9 @@ Perl_cvgv_set(pTHX_ CV* cv, GV* gv) sv_del_backref(MUTABLE_SV(oldgv), MUTABLE_SV(cv)); } } + else if ((hek = CvNAME_HEK(cv))) unshare_hek(hek); - SvANY(cv)->xcv_gv = gv; + SvANY(cv)->xcv_gv_u.xcv_gv = gv; assert(!CvCVGV_RC(cv)); if (!gv) |