Message-ID: <
3FBB8087.20206@sun.com>
p4raw-id: //depot/perl@21748
xhv = (XPVHV*)SvANY(hv);
- if (SvREADONLY(hv)) {
+ if (SvREADONLY(hv) && xhv->xhv_array != NULL) {
/* restricted hash: convert all keys to placeholders */
I32 i;
HE* entry;
chdir 't';
}
}
-use Test::More tests => 157;
+use Test::More tests => 159;
use strict;
my @Exported_Funcs;
}
}
+# 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");