develooper Front page | perl.perl5.porters | Postings from August 2003

Re: Storable Error

Thread Previous | Thread Next
From:
Abhijit Menon-Sen
Date:
August 9, 2003 12:38
Subject:
Re: Storable Error
Message ID:
20030810010755.A24105@lustre.dyn.wiw.org
At 2003-08-09 00:35:36 +0100, nick@ccl4.org wrote:
>
> I find that I can create hashes where key flags are set but HASKFLAGS
> is not with the appended patch, and running t/op/utfhash.t with -DA

Nicholas, thank you ever so much. With your patch as a starting point, I
found: chop ($a = "\x{df}".chr 256); $a{$a} = $a{"\x{df}"} = 1; %a = ();

The problem was much easier to track down thereafter. The appended patch
seems to fix it and break nothing else. I've applied it as #20587, but I
would appreciate it if you could cast an eye over it. (Can you think of
any cases I've missed?)

Jesse, this should fix the "Storable problem" people have reported under
RH9. It seems there are some things that Red Hat's Perl can't be blamed
for, after all. :-)

Jarkko, please absorb this into 5.8.1 after Nicholas writes a test^W^W^W
comments on it.

-- ams

--- hv.c~	Sat Aug  9 23:43:53 2003
+++ hv.c	Sun Aug 10 00:25:09 2003
@@ -308,6 +308,8 @@ S_hv_fetch_flags(pTHX_ HV *hv, const cha
             }
             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 *keys
             }
             else
                 HeKFLAGS(entry) = flags;
+            if (flags)
+                HvHASKFLAGS_on(hv);
         }
        if (key != keysave)
            Safefree(key);

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About