From: Abhijit Menon-Sen Date: Tue, 12 Jun 2001 12:47:04 +0000 (+0530) Subject: anonymous stashes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6676db263f08eab1c09a46739d7c3c0d2ea7f6df;p=p5sagit%2Fp5-mst-13.2.git anonymous stashes Message-ID: <20010612124704.A29029@lustre.linux.in> p4raw-id: //depot/perl@10533 --- diff --git a/dump.c b/dump.c index 4547aea..bbbcec3 100644 --- a/dump.c +++ b/dump.c @@ -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)); } diff --git a/gv.c b/gv.c index c0f0d93..71ec31d 100644 --- a/gv.c +++ b/gv.c @@ -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 */ diff --git a/sv.c b/sv.c index 8ad8594..3ae98ef 100644 --- a/sv.c +++ b/sv.c @@ -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(); diff --git a/xsutils.c b/xsutils.c index 1a95191..9df4ce4 100644 --- a/xsutils.c +++ b/xsutils.c @@ -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: