summaryrefslogtreecommitdiff
path: root/hv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-09-19 18:11:40 +0000
committerNicholas Clark <nick@ccl4.org>2007-09-19 18:11:40 +0000
commit642cebe60d6a8fd4d4840b0f7ca731bb215af062 (patch)
treecbaccacc549aed20ec7ea9c82fc5eeaec2333d05 /hv.c
parentbdee33e435b03e47d573fcaecde743ced828beef (diff)
downloadperl-642cebe60d6a8fd4d4840b0f7ca731bb215af062.tar.gz
ext/XS/APItest/t/hash.t was failing because the fieldhash code didn't
reset the pre-computed hash value. p4raw-id: //depot/perl@31913
Diffstat (limited to 'hv.c')
-rw-r--r--hv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hv.c b/hv.c
index 6d7c25adc7..7697feacb4 100644
--- a/hv.c
+++ b/hv.c
@@ -431,6 +431,7 @@ S_hv_fetch_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
However, as we replace the original key with the converted
key, this would result in a double conversion, which would show
up as a bug if the conversion routine is not idempotent. */
+ hash = 0;
}
if (keysv) {
if (flags & HVhek_FREEKEY)
@@ -966,8 +967,10 @@ S_hv_delete_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
return NULL;
if (SvSMAGICAL(hv) && SvGMAGICAL(hv)
- && !(d_flags & HV_DISABLE_UVAR_XKEY))
+ && !(d_flags & HV_DISABLE_UVAR_XKEY)) {
keysv = hv_magic_uvar_xkey(hv, keysv, key, klen, k_flags, HV_DELETE);
+ hash = 0;
+ }
if (keysv) {
if (k_flags & HVhek_FREEKEY)
Safefree(key);