hv_fetch_{ent,flags} failed to set HvHASKFLAGS on a hash where a
Abhijit Menon-Sen [Sat, 9 Aug 2003 18:09:34 +0000 (18:09 +0000)]
normal key was replaced by its UTF-8 equivalent. This caused the
"Storable problem" RT3 users reported under RH9.

p4raw-id: //depot/perl@20587

hv.c

diff --git a/hv.c b/hv.c
index 78082d0..63e112a 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -308,6 +308,8 @@ S_hv_fetch_flags(pTHX_ HV *hv, const char *key, I32 klen, I32 lval, int flags)
             }
             else
                 HeKFLAGS(entry) = flags;
+            if (flags)
+                HvHASKFLAGS_on(hv);
         }
         if (flags & HVhek_FREEKEY)
             Safefree(key);
@@ -478,6 +480,8 @@ Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash)
             }
             else
                 HeKFLAGS(entry) = flags;
+            if (flags)
+                HvHASKFLAGS_on(hv);
         }
        if (key != keysave)
            Safefree(key);