diff options
author | Brian Fraser <fraserbn@gmail.com> | 2011-10-01 22:14:50 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-10-06 13:01:00 -0700 |
commit | 9cc50d5bae7393fdf31d09472cbd42a45f1698c8 (patch) | |
tree | 0a71fdbc1a40e4ade9f67f4b8bd787dde06af4b9 /gv.c | |
parent | 0eeb01b957d2d66eec1a0e1e347c6d8772e5284e (diff) | |
download | perl-9cc50d5bae7393fdf31d09472cbd42a45f1698c8.tar.gz |
gv.c: newGVgen_flags and a flags parameter for gv_get_super_pkg.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -891,7 +891,7 @@ C<call_sv> 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 */ |