summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-09-30 15:11:07 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-09-30 15:11:07 +0000
commit8206a063cdc1c193b12df1a45cb3a0ee430b5077 (patch)
tree45fb29ee11703ddeadeb8fa6d9673bc12d51394b /pp_hot.c
parent2ddcc7aa6c936ba8e7a9703319dfd8959bb54574 (diff)
parent3e3baf6d63945cb64e829d6e5c70a7d00f3d3d03 (diff)
downloadperl-8206a063cdc1c193b12df1a45cb3a0ee430b5077.tar.gz
Merge maint-5.004 branch (5.004_01) with mainline.
p4raw-id: //depot/perl@84
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 985286f918..e8cb782145 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -650,13 +650,17 @@ PP(pp_aassign)
av_extend(ary, lastrelem - relem);
i = 0;
while (relem <= lastrelem) { /* gobble up all the rest */
+ SV **didstore;
sv = NEWSV(28,0);
assert(*relem);
sv_setsv(sv,*relem);
*(relem++) = sv;
- (void)av_store(ary,i++,sv);
- if (magic)
+ didstore = av_store(ary,i++,sv);
+ if (magic) {
mg_set(sv);
+ if (!didstore)
+ SvREFCNT_dec(sv);
+ }
TAINT_NOT;
}
break;
@@ -669,6 +673,7 @@ PP(pp_aassign)
while (relem < lastrelem) { /* gobble up all the rest */
STRLEN len;
+ HE *didstore;
if (*relem)
sv = *(relem++);
else
@@ -677,9 +682,12 @@ PP(pp_aassign)
if (*relem)
sv_setsv(tmpstr,*relem); /* value */
*(relem++) = tmpstr;
- (void)hv_store_ent(hash,sv,tmpstr,0);
- if (magic)
+ didstore = hv_store_ent(hash,sv,tmpstr,0);
+ if (magic) {
mg_set(tmpstr);
+ if (!didstore)
+ SvREFCNT_dec(tmpstr);
+ }
TAINT_NOT;
}
if (relem == lastrelem)