From 9cc50d5bae7393fdf31d09472cbd42a45f1698c8 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Sat, 1 Oct 2011 22:14:50 -0700 Subject: gv.c: newGVgen_flags and a flags parameter for gv_get_super_pkg. --- gv.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'gv.c') diff --git a/gv.c b/gv.c index e363a4c449..fa5ed65868 100644 --- a/gv.c +++ b/gv.c @@ -891,7 +891,7 @@ C apply equally to these functions. */ STATIC HV* -S_gv_get_super_pkg(pTHX_ const char* name, I32 namelen) +S_gv_get_super_pkg(pTHX_ const char* name, I32 namelen, U32 flags) { AV* superisa; GV** gvp; @@ -991,7 +991,7 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le SV * const tmpstr = sv_2mortal(Perl_newSVpvf(aTHX_ "%s::SUPER", CopSTASHPV(PL_curcop))); /* __PACKAGE__::SUPER stash should be autovivified */ - stash = gv_get_super_pkg(SvPVX_const(tmpstr), SvCUR(tmpstr)); + stash = gv_get_super_pkg(SvPVX_const(tmpstr), SvCUR(tmpstr), SvUTF8(tmpstr)); DEBUG_o( Perl_deb(aTHX_ "Treating %s as %s::%s\n", origname, HvNAME_get(stash), name) ); } @@ -1004,7 +1004,7 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le if (!stash && (nsplit - origname) >= 7 && strnEQ(nsplit - 7, "::SUPER", 7) && gv_stashpvn(origname, nsplit - origname - 7, 0)) - stash = gv_get_super_pkg(origname, nsplit - origname); + stash = gv_get_super_pkg(origname, nsplit - origname, flags); } ostash = stash; } @@ -2028,14 +2028,16 @@ Perl_gv_check(pTHX_ const HV *stash) } GV * -Perl_newGVgen(pTHX_ const char *pack) +Perl_newGVgen_flags(pTHX_ const char *pack, U32 flags) { dVAR; + PERL_ARGS_ASSERT_NEWGVGEN_FLAGS; - PERL_ARGS_ASSERT_NEWGVGEN; - - return gv_fetchpv(Perl_form(aTHX_ "%s::_GEN_%ld", pack, (long)PL_gensym++), - GV_ADD, SVt_PVGV); + return gv_fetchpv(Perl_form(aTHX_ "%"SVf"::_GEN_%ld", + SVfARG(newSVpvn_flags(pack, strlen(pack), + SVs_TEMP | flags)), + (long)PL_gensym++), + GV_ADD, SVt_PVGV); } /* hopefully this is only called on local symbol table entries */ -- cgit v1.2.1