In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/2793cb42c554ddf216f1ffc5a6d2a867adcd6c0d?hp=cba0b53980b869e0b7ceaf81166f64dd51ca7c12>
- Log ----------------------------------------------------------------- commit 2793cb42c554ddf216f1ffc5a6d2a867adcd6c0d Author: Chas. Owens <chas.ow...@gmail.com> Date: Thu Sep 16 16:59:30 2010 +0200 reftype() used without checking for undef Hash::Util used "reftype($v) eq 'HASH'" without checking for undefinendness. This patch rectifies that. Also bumps Hash::Util version. Original patch and detective work by Chas. Owens. Modified by Steffen Mueller. ----------------------------------------------------------------------- Summary of changes: ext/Hash-Util/lib/Hash/Util.pm | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/Hash-Util/lib/Hash/Util.pm b/ext/Hash-Util/lib/Hash/Util.pm index 95da7d9..49d38e0 100644 --- a/ext/Hash-Util/lib/Hash/Util.pm +++ b/ext/Hash-Util/lib/Hash/Util.pm @@ -29,7 +29,7 @@ our @EXPORT_OK = qw( hash_seed hv_store ); -our $VERSION = '0.08'; +our $VERSION = '0.09'; require DynaLoader; local @ISA = qw(DynaLoader); bootstrap Hash::Util $VERSION; @@ -321,7 +321,8 @@ sub lock_hashref_recurse { lock_ref_keys($hash); foreach my $value (values %$hash) { - if (reftype($value) eq 'HASH') { + my $type = reftype($value); + if (defined($type) and $type eq 'HASH') { lock_hashref_recurse($value); } Internals::SvREADONLY($value,1); @@ -333,7 +334,8 @@ sub unlock_hashref_recurse { my $hash = shift; foreach my $value (values %$hash) { - if (reftype($value) eq 'HASH') { + my $type = reftype($value); + if (defined($type) and $type eq 'HASH') { unlock_hashref_recurse($value); } Internals::SvREADONLY($value,1); -- Perl5 Master Repository