diff options
author | Abhijit Menon-Sen <ams@wiw.org> | 2001-06-12 18:17:04 +0530 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-12 12:52:57 +0000 |
commit | 6676db263f08eab1c09a46739d7c3c0d2ea7f6df (patch) | |
tree | ef7031b813cbdd0ae5c4da9d2326a999a199a8c9 | |
parent | 65b8483b5f20b88f3e36de22e5236706cd8b1e3b (diff) | |
download | perl-6676db263f08eab1c09a46739d7c3c0d2ea7f6df.tar.gz |
anonymous stashes
Message-ID: <20010612124704.A29029@lustre.linux.in>
p4raw-id: //depot/perl@10533
-rw-r--r-- | dump.c | 6 | ||||
-rw-r--r-- | gv.c | 4 | ||||
-rw-r--r-- | sv.c | 4 | ||||
-rw-r--r-- | xsutils.c | 7 |
4 files changed, 9 insertions, 12 deletions
@@ -60,8 +60,8 @@ Perl_dump_packsubs(pTHX_ HV *stash) dump_sub(gv); if (GvFORM(gv)) dump_form(gv); - if (HeKEY(entry)[HeKLEN(entry)-1] == ':' && - (hv = GvHV(gv)) && HvNAME(hv) && hv != PL_defstash) + if (HeKEY(entry)[HeKLEN(entry)-1] == ':' + && (hv = GvHV(gv)) && hv != PL_defstash) dump_packsubs(hv); /* nested package */ } } @@ -883,7 +883,7 @@ Perl_do_gvgv_dump(pTHX_ I32 level, PerlIO *file, char *name, GV *sv) Perl_dump_indent(aTHX_ level, file, "%s = 0x%"UVxf, name, PTR2UV(sv)); if (sv && GvNAME(sv)) { PerlIO_printf(file, "\t\""); - if (GvSTASH(sv) && HvNAME(GvSTASH(sv))) + if (GvSTASH(sv)) PerlIO_printf(file, "%s\" :: \"", HvNAME(GvSTASH(sv))); PerlIO_printf(file, "%s\"\n", GvNAME(sv)); } @@ -195,8 +195,6 @@ Perl_gv_fetchmeth(pTHX_ HV *stash, const char *name, STRLEN len, I32 level) return 0; } - if (!HvNAME(stash)) - Perl_croak(aTHX_ "Can't use anonymous symbol table for method lookup"); if ((level > 100) || (level < -100)) Perl_croak(aTHX_ "Recursive inheritance detected while looking for method '%s' in package '%s'", name, HvNAME(stash)); @@ -1077,7 +1075,7 @@ Perl_gv_check(pTHX_ HV *stash) for (i = 0; i <= (I32) HvMAX(stash); i++) { for (entry = HvARRAY(stash)[i]; entry; entry = HeNEXT(entry)) { if (HeKEY(entry)[HeKLEN(entry)-1] == ':' && - (gv = (GV*)HeVAL(entry)) && (hv = GvHV(gv)) && HvNAME(hv)) + (gv = (GV*)HeVAL(entry)) && (hv = GvHV(gv))) { if (hv != PL_defstash && hv != stash) gv_check(hv); /* nested package */ @@ -8164,8 +8164,8 @@ Perl_sv_dup(pTHX_ SV *sstr) } HvPMROOT((HV*)dstr) = HvPMROOT((HV*)sstr); /* XXX */ HvNAME((HV*)dstr) = SAVEPV(HvNAME((HV*)sstr)); - if(HvNAME((HV*)dstr)) - av_push(PL_clone_callbacks,dstr); + if(HvNAME((HV*)dstr)) + av_push(PL_clone_callbacks, dstr); break; case SVt_PVFM: SvANY(dstr) = new_XPVFM(); @@ -231,10 +231,9 @@ usage: HV *stash = Nullhv; switch (SvTYPE(sv)) { case SVt_PVCV: - if (CvGV(sv) && isGV(CvGV(sv)) && GvSTASH(CvGV(sv)) && - HvNAME(GvSTASH(CvGV(sv)))) + if (CvGV(sv) && isGV(CvGV(sv)) && GvSTASH(CvGV(sv))) stash = GvSTASH(CvGV(sv)); - else if (/* !CvANON(sv) && */ CvSTASH(sv) && HvNAME(CvSTASH(sv))) + else if (/* !CvANON(sv) && */ CvSTASH(sv)) stash = CvSTASH(sv); break; case SVt_PVMG: @@ -242,7 +241,7 @@ usage: break; /*FALLTHROUGH*/ case SVt_PVGV: - if (GvGP(sv) && GvESTASH((GV*)sv) && HvNAME(GvESTASH((GV*)sv))) + if (GvGP(sv) && GvESTASH((GV*)sv)) stash = GvESTASH((GV*)sv); break; default: |