This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Superparanoia.
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 8 Sep 2003 12:15:23 +0000 (12:15 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 8 Sep 2003 12:15:23 +0000 (12:15 +0000)
p4raw-id: //depot/perl@21085

util.c

diff --git a/util.c b/util.c
index 7f38135..39122be 100644 (file)
--- a/util.c
+++ b/util.c
@@ -4422,6 +4422,8 @@ Perl_get_hash_seed(pTHX)
          myseed +=
               (UV)(Drand01() * (NV)((1 << ((UVSIZE * 8 - RANDBITS))) - 1));
 #endif /* RANDBITS < (UVSIZE * 8) */
+         while (myseed == 0) /* Superparanoia. */
+             myseed += (UV)(Drand01() * (NV)UV_MAX);
      }
      PL_hash_seed_set = TRUE;