From: Rafael Garcia-Suarez Date: Mon, 25 Oct 2004 15:31:21 +0000 (+0000) Subject: Fix [perl #32130] Errno.pm must not pass references to "prototype" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f8ed3476f18eeb645feeb028cc05ab8e72bae078;p=p5sagit%2Fp5-mst-13.2.git Fix [perl #32130] Errno.pm must not pass references to "prototype" p4raw-id: //depot/perl@23424 --- diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index fdab9ee..a795cfc 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -377,7 +377,8 @@ sub FIRSTKEY { sub EXISTS { my ($self, $errname) = @_; - my $proto = prototype($errname); + my $r = ref $errname; + my $proto = !$r || $r eq 'CODE' ? prototype($errname) : undef; defined($proto) && $proto eq ""; } diff --git a/ext/Errno/t/Errno.t b/ext/Errno/t/Errno.t index a879cf2..a6b08e0 100755 --- a/ext/Errno/t/Errno.t +++ b/ext/Errno/t/Errno.t @@ -13,7 +13,7 @@ BEGIN { use Errno; -print "1..5\n"; +print "1..6\n"; print "not " unless @Errno::EXPORT_OK; print "ok 1\n"; @@ -53,3 +53,6 @@ if($s1 ne $s2) { } print "ok 5\n"; + +eval { exists $!{[]} }; +print $@ ? "not ok 6\n" : "ok 6\n";