This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorNicholas Clark <nick@ccl4.org>
Thu, 29 Jul 2004 22:05:16 +0000 (22:05 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 29 Jul 2004 22:05:16 +0000 (22:05 +0000)
[ 23058]
Stop ENV_IS_CASELESS hv.c picking up the wrong hash value from a
shared string scalar.

[ 23061]
hv_store was not passing hash onwards (spotted by Dave)
p4raw-link: @23061 on //depot/perl: 52d01cc22f218c2d828b1db06a67c612a02ebd47
p4raw-link: @23058 on //depot/perl: 8b4f7dd5e1f209efbb2b0c869593cbad5c938b49

p4raw-id: //depot/maint-5.8/perl@23169
p4raw-integrated: from //depot/perl@23153 'edit in' hv.c (@23058..)

hv.c

diff --git a/hv.c b/hv.c
index 0632ab1..570bb67 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -218,7 +218,7 @@ Perl_hv_store(pTHX_ HV *hv, const char *key, I32 klen_i32, SV *val, U32 hash)
        flags = 0;
     }
     hek = hv_fetch_common (hv, NULL, key, klen, flags,
-                          (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, 0);
+                          (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, hash);
     return hek ? &HeVAL(hek) : NULL;
 }
 
@@ -505,6 +505,7 @@ S_hv_fetch_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
                key = (const char*)strupr((char*)key);
                is_utf8 = 0;
                hash = 0;
+               keysv = 0;
 
                if (flags & HVhek_FREEKEY) {
                    Safefree(keysave);
@@ -547,6 +548,7 @@ S_hv_fetch_common(pTHX_ HV *hv, SV *keysv, const char *key, STRLEN klen,
                    key = (const char*)strupr((char*)key);
                    is_utf8 = 0;
                    hash = 0;
+                   keysv = 0;
 
                    if (flags & HVhek_FREEKEY) {
                        Safefree(keysave);