summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-07-01 23:21:49 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-07-01 23:21:49 +0000
commit6a0deba8537181f0c697c91c2e093de6e8388d91 (patch)
tree14283c9b238ad5ce392cc44f8aeb03cc19c079bf /pp_hot.c
parentf4b17341914f3e4612b10c6ef1fd735c795a8aef (diff)
downloadperl-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.c32
1 files changed, 23 insertions, 9 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 8331bb36a9..bd8a74e81f 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;