From: Gurusamy Sarathy Date: Wed, 1 Jul 1998 23:21:49 +0000 (+0000) Subject: fix C<@a = (%a = 1)> bizarreness X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6a0deba8537181f0c697c91c2e093de6e8388d91;p=p5sagit%2Fp5-mst-13.2.git fix C<@a = (%a = 1)> bizarreness p4raw-id: //depot/perl@1272 --- diff --git a/pp_hot.c b/pp_hot.c index 8331bb3..bd8a74e 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -626,7 +626,6 @@ PP(pp_aassign) hv_clear(hash); while (relem < lastrelem) { /* gobble up all the rest */ - STRLEN len; HE *didstore; if (*relem) sv = *(relem++); @@ -645,14 +644,29 @@ PP(pp_aassign) } TAINT_NOT; } - if (relem == lastrelem && dowarn) { - if (relem == firstrelem && - SvROK(*relem) && - ( SvTYPE(SvRV(*relem)) == SVt_PVAV || - SvTYPE(SvRV(*relem)) == SVt_PVHV ) ) - warn("Reference found where even-sized list expected"); - else - warn("Odd number of elements in hash assignment"); + if (relem == lastrelem) { + if (*relem) { + HE *didstore; + if (dowarn) { + if (relem == firstrelem && + SvROK(*relem) && + ( SvTYPE(SvRV(*relem)) == SVt_PVAV || + SvTYPE(SvRV(*relem)) == SVt_PVHV ) ) + warn("Reference found where even-sized list expected"); + else + warn("Odd number of elements in hash assignment"); + } + tmpstr = NEWSV(29,0); + didstore = hv_store_ent(hash,*relem,tmpstr,0); + if (magic) { + if (SvSMAGICAL(tmpstr)) + mg_set(tmpstr); + if (!didstore) + SvREFCNT_dec(tmpstr); + } + TAINT_NOT; + } + relem++; } } break;