From c220e1a11e00efe060ea99925553cb1e03e3363a Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 7 Jul 2012 23:39:07 -0700 Subject: Correct err msg when calling stub w/no autoload fb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If an AUTOLOAD subroutine loads a sub by assigning to the glob, there may be code elsewhere that has a reference to a stub, that is now assigned over. To cope with this situation, calls to undefined sub- routines will fall back to whatever sub is in the subroutine’s owner typeglob. This has been the case since Perl 5.000. But the error message that occurs if the typeglob happens to have no sub in it is wrong: $ perl -e ' my $foosub = \&foo; undef *foo; &$foosub; ' Not a CODE reference at -e line 4. as opposed to this: $ perl -e ' my $foosub = \&foo; &$foosub; ' Undefined subroutine &main::foo called at -e line 3. They should both produce the same error message, because $foosub is a code reference, albeit without a body. --- MANIFEST | 1 + 1 file changed, 1 insertion(+) (limited to 'MANIFEST') diff --git a/MANIFEST b/MANIFEST index 7a5d0c072c..1396660928 100644 --- a/MANIFEST +++ b/MANIFEST @@ -5034,6 +5034,7 @@ t/lib/compmod.pl Helper for 1_compile.t t/lib/croak/mg Test croak calls from mg.c t/lib/croak/op Test croak calls from op.c t/lib/croak/pp_ctl Test croak calls from pp_ctl.c +t/lib/croak/pp_hot Test croak calls from pp_hot.c t/lib/croak.t Test calls to Perl_croak() in the C source. t/lib/croak/toke Test croak calls from toke.c t/lib/cygwin.t Builtin cygwin function tests -- cgit v1.2.1