From: Dave Mitchell Date: Tue, 17 Feb 2004 18:23:27 +0000 (+0000) Subject: Slight update to #22315 ($lval=*FOO); optimise the hot tests, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b76195c2c3fed0c4902274b97cce28883ff67d65;p=p5sagit%2Fp5-mst-13.2.git Slight update to #22315 ($lval=*FOO); optimise the hot tests, and fix some incorrect indentation p4raw-id: //depot/perl@22316 --- diff --git a/pp.c b/pp.c index 3426ca2..8e50bec5d 100644 --- a/pp.c +++ b/pp.c @@ -830,7 +830,7 @@ PP(pp_undef) PP(pp_predec) { dSP; - if (SvTYPE(TOPs) == SVt_PVGV || SvTYPE(TOPs) > SVt_PVLV) + if (SvTYPE(TOPs) >= SVt_PVGV && ! SvTYPE(TOPs) == SVt_PVLV) DIE(aTHX_ PL_no_modify); if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs) && SvIVX(TOPs) != IV_MIN) @@ -847,7 +847,7 @@ PP(pp_predec) PP(pp_postinc) { dSP; dTARGET; - if (SvTYPE(TOPs) == SVt_PVGV || SvTYPE(TOPs) > SVt_PVLV) + if (SvTYPE(TOPs) >= SVt_PVGV && ! SvTYPE(TOPs) == SVt_PVLV) DIE(aTHX_ PL_no_modify); sv_setsv(TARG, TOPs); if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs) @@ -869,7 +869,7 @@ PP(pp_postinc) PP(pp_postdec) { dSP; dTARGET; - if (SvTYPE(TOPs) == SVt_PVGV || SvTYPE(TOPs) > SVt_PVLV) + if (SvTYPE(TOPs) >= SVt_PVGV && ! SvTYPE(TOPs) == SVt_PVLV) DIE(aTHX_ PL_no_modify); sv_setsv(TARG, TOPs); if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs) diff --git a/pp_hot.c b/pp_hot.c index 48ac968..7505467 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -295,7 +295,7 @@ PP(pp_eq) PP(pp_preinc) { dSP; - if (SvTYPE(TOPs) == SVt_PVGV || SvTYPE(TOPs) > SVt_PVLV) + if (SvTYPE(TOPs) >= SVt_PVGV && ! SvTYPE(TOPs) == SVt_PVLV) DIE(aTHX_ PL_no_modify); if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs) && SvIVX(TOPs) != IV_MAX) diff --git a/sv.c b/sv.c index 3d8ad42..ca66f7d 100644 --- a/sv.c +++ b/sv.c @@ -1455,11 +1455,11 @@ Perl_sv_upgrade(pTHX_ register SV *sv, U32 mt) LvTARGLEN(sv) = 0; LvTARG(sv) = 0; LvTYPE(sv) = 0; - GvGP(sv) = 0; - GvNAME(sv) = 0; - GvNAMELEN(sv) = 0; - GvSTASH(sv) = 0; - GvFLAGS(sv) = 0; + GvGP(sv) = 0; + GvNAME(sv) = 0; + GvNAMELEN(sv) = 0; + GvSTASH(sv) = 0; + GvFLAGS(sv) = 0; break; case SVt_PVAV: SvANY(sv) = new_XPVAV(); @@ -3788,8 +3788,9 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags) if (dtype != SVt_PVGV) { char *name = GvNAME(sstr); STRLEN len = GvNAMELEN(sstr); - if (dtype != SVt_PVLV) /* don't upgrade SVt_PVLV: it can hold a glob */ - sv_upgrade(dstr, SVt_PVGV); + /* don't upgrade SVt_PVLV: it can hold a glob */ + if (dtype != SVt_PVLV) + sv_upgrade(dstr, SVt_PVGV); sv_magic(dstr, dstr, PERL_MAGIC_glob, Nullch, 0); GvSTASH(dstr) = (HV*)SvREFCNT_inc(GvSTASH(sstr)); GvNAME(dstr) = savepvn(name, len);