diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-01 23:21:49 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-07-01 23:21:49 +0000 |
commit | 6a0deba8537181f0c697c91c2e093de6e8388d91 (patch) | |
tree | 14283c9b238ad5ce392cc44f8aeb03cc19c079bf /pp_hot.c | |
parent | f4b17341914f3e4612b10c6ef1fd735c795a8aef (diff) | |
download | perl-6a0deba8537181f0c697c91c2e093de6e8388d91.tar.gz |
fix C<@a = (%a = 1)> bizarreness
p4raw-id: //depot/perl@1272
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 32 |
1 files changed, 23 insertions, 9 deletions
@@ -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; |