summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-10-24 18:39:25 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-24 18:39:25 -0700
commit96517a90c6cb5ea3aaf4304897cd4eb1db2d2305 (patch)
tree7cde4413c78951fa527318e4c212a59adbaafcaf /hv.c
parent8752206e276cffe588c0932b5a9f2331640e8447 (diff)
downloadperl-96517a90c6cb5ea3aaf4304897cd4eb1db2d2305.tar.gz
Memory-management macros evaluate their arguments multiple times
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hv.c b/hv.c
index 89941d8375..0b347f5788 100644
--- a/hv.c
+++ b/hv.c
@@ -2075,7 +2075,8 @@ Perl_hv_name_add(pTHX_ HV *hv, const char *name, U32 len)
if (
HEK_LEN(*hekp) == (I32)len && memEQ(HEK_KEY(*hekp), name, len)
) return;
- Renewc(aux->xhv_name, ++aux->xhv_name_count, HEK *, HEK);
+ aux->xhv_name_count++;
+ Renewc(aux->xhv_name, aux->xhv_name_count, HEK *, HEK);
((HEK **)aux->xhv_name)[count] = share_hek(name, len, hash);
}
else {
@@ -2084,7 +2085,8 @@ Perl_hv_name_add(pTHX_ HV *hv, const char *name, U32 len)
HEK_LEN(existing_name) == (I32)len
&& memEQ(HEK_KEY(existing_name), name, len)
) return;
- Newxc(aux->xhv_name, aux->xhv_name_count = 2, HEK *, HEK);
+ Newxc(aux->xhv_name, 2, HEK *, HEK);
+ aux->xhv_name_count = 2;
*(HEK **)aux->xhv_name = existing_name;
((HEK **)aux->xhv_name)[1] = share_hek(name, len, hash);
}