summaryrefslogtreecommitdiff
path: root/inline.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-08-28 18:26:36 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-15 06:19:32 -0700
commitae77754ae288180ef1b6bab63dd49fa724d9fddd (patch)
tree2117fa17eff09c3b743f144a60d16c352c152bcd /inline.h
parente38faec93a3dca999da366b2f1cec7a005c2b41b (diff)
downloadperl-ae77754ae288180ef1b6bab63dd49fa724d9fddd.tar.gz
For lexical subs, reify CvGV from CvSTASH and CvNAME_HEK
From now on, the presence of a name hek implies a GV. Any access to CvGV will cause that implicit GV to be reified.
Diffstat (limited to 'inline.h')
-rw-r--r--inline.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/inline.h b/inline.h
index 0792694650..ad6edf20df 100644
--- a/inline.h
+++ b/inline.h
@@ -25,6 +25,14 @@ S_av_top_index(pTHX_ AV *av)
/* ------------------------------- cv.h ------------------------------- */
+PERL_STATIC_INLINE GV *
+S_CvGV(pTHX_ CV *sv)
+{
+ return CvNAMED(sv)
+ ? Perl_cvgv_from_hek(aTHX_ sv)
+ : ((XPVCV*)MUTABLE_PTR(SvANY(sv)))->xcv_gv_u.xcv_gv;
+}
+
PERL_STATIC_INLINE I32 *
S_CvDEPTHp(const CV * const sv)
{