From: Abhijit Menon-Sen Date: Sun, 17 Jun 2001 11:44:06 +0000 (+0530) Subject: more anonymous stash cleanups X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a9164de832b5ec51cc67c737aaac2bb30eed3d1e;p=p5sagit%2Fp5-mst-13.2.git more anonymous stash cleanups Message-ID: <20010617114406.A25203@lustre.linux.in> p4raw-id: //depot/perl@10657 --- diff --git a/op.c b/op.c index 6e42527..73061e3 100644 --- a/op.c +++ b/op.c @@ -1869,7 +1869,7 @@ S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs) /* fake up C */ ENTER; /* need to protect against side-effects of 'use' */ SAVEINT(PL_expect); - if (stash && HvNAME(stash)) + if (stash) stashsv = newSVpv(HvNAME(stash), 0); else stashsv = &PL_sv_no; @@ -1969,8 +1969,7 @@ S_my_kid(pTHX_ OP *o, OP *attrs) /* check for C when deciding package */ namesvp = av_fetch(PL_comppad_name, o->op_targ, FALSE); - if (namesvp && *namesvp && (SvFLAGS(*namesvp) & SVpad_TYPED) - && HvNAME(SvSTASH(*namesvp))) + if (namesvp && *namesvp && (SvFLAGS(*namesvp) & SVpad_TYPED)) stash = SvSTASH(*namesvp); else stash = PL_curstash; @@ -4668,9 +4667,9 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) */ if (cv && !block) { rcv = (SV*)cv; - if (CvGV(cv) && GvSTASH(CvGV(cv)) && HvNAME(GvSTASH(CvGV(cv)))) + if (CvGV(cv) && GvSTASH(CvGV(cv))) stash = GvSTASH(CvGV(cv)); - else if (CvSTASH(cv) && HvNAME(CvSTASH(cv))) + else if (CvSTASH(cv)) stash = CvSTASH(cv); else stash = PL_curstash; @@ -4678,7 +4677,7 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) else { /* possibly about to re-define existing subr -- ignore old cv */ rcv = (SV*)PL_compcv; - if (name && GvSTASH(gv) && HvNAME(GvSTASH(gv))) + if (name && GvSTASH(gv)) stash = GvSTASH(gv); else stash = PL_curstash; @@ -4992,7 +4991,6 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename) else if (CvROOT(cv) || CvXSUB(cv) || GvASSUMECV(gv)) { /* already defined (or promised) */ if (ckWARN(WARN_REDEFINE) && !(CvGV(cv) && GvSTASH(CvGV(cv)) - && HvNAME(GvSTASH(CvGV(cv))) && strEQ(HvNAME(GvSTASH(CvGV(cv))), "autouse"))) { line_t oldline = CopLINE(PL_curcop); if (PL_copline != NOLINE)