Change 20009 by [EMAIL PROTECTED] on 2003/07/05 10:56:55
The logic for additional randomisation for 64-bit UV
cases was wrong.
Affected files ...
... //depot/perl/perl.c#504 edit
Differences ...
==== //depot/perl/perl.c#504 (text) ====
Index: perl/perl.c
--- perl/perl.c#503~20008~ Sat Jul 5 02:10:46 2003
+++ perl/perl.c Sat Jul 5 03:56:55 2003
@@ -917,12 +917,12 @@
PL_srand_called = TRUE;
PL_hash_seed = (UV)(Drand01() * (NV)UV_MAX);
#if RANDBITS < (UVSIZE * 8)
- {
- int skip = (UVSIZE * 8) - RANDBITS;
- PL_hash_seed >>= skip;
- /* The low bits might need extra help. */
- PL_hash_seed += (UV)(Drand01() * ((1 << skip) - 1));
- }
+ /* Since there are not enough randbits to to reach all
+ * the bits of a UV, the low bits might need extra
+ * help. Sum in another random number that will
+ * fill in the low bits. */
+ PL_hash_seed +=
+ (UV)(Drand01() * (NV)((1 << ((UVSIZE * 8 - RANDBITS))) - 1));
#endif /* RANDBITS < (UVSIZE * 8) */
}
#endif /* USE_HASH_SEED_EXPLICIT */
End of Patch.