summaryrefslogtreecommitdiff
path: root/lib/Hash
diff options
context:
space:
mode:
authorAlan Burlison <Alan.Burlison@uk.sun.com>2003-11-19 14:39:03 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-19 19:56:20 +0000
commit5f099cb0574fe51d7450374a7827fa9383ec0061 (patch)
treec8d5553710871948d89954766b9ba98a18be12f8 /lib/Hash
parent715961523dc15717482c3eba9a533ed292b5a722 (diff)
downloadperl-5f099cb0574fe51d7450374a7827fa9383ec0061.tar.gz
clear of empty locked hash SEGVs
Message-ID: <3FBB8087.20206@sun.com> p4raw-id: //depot/perl@21748
Diffstat (limited to 'lib/Hash')
-rw-r--r--lib/Hash/Util.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/Hash/Util.t b/lib/Hash/Util.t
index 48cbc7c007..1c77728c27 100644
--- a/lib/Hash/Util.t
+++ b/lib/Hash/Util.t
@@ -6,7 +6,7 @@ BEGIN {
chdir 't';
}
}
-use Test::More tests => 157;
+use Test::More tests => 159;
use strict;
my @Exported_Funcs;
@@ -274,5 +274,19 @@ like( $@, qr/^Attempt to access disallowed key 'I_DONT_EXIST' in a restricted ha
}
}
+# Check clear works on locked empty hashes - SEGVs on 5.8.2.
+{
+ my %hash;
+ lock_hash(%hash);
+ %hash = ();
+ ok(keys(%hash) == 0, 'clear empty lock_hash() hash');
+}
+{
+ my %hash;
+ lock_keys(%hash);
+ %hash = ();
+ ok(keys(%hash) == 0, 'clear empty lock_keys() hash');
+}
+
my $hash_seed = hash_seed();
ok($hash_seed >= 0, "hash_seed $hash_seed");