This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #71154] undef &$coderef consistency
authorFather Chrysostomos <sprout@cpan.org>
Thu, 25 Aug 2011 05:16:07 +0000 (22:16 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 25 Aug 2011 05:16:07 +0000 (22:16 -0700)
commit2c37437046bfc1b5f46302ce005c170a3bac504b
tree0742d9a2268f60dc6210cfda54746e9cd87ba8d3
parent73ff03e80797f5abfbbb570cc398cc59078bc6d5
[perl #71154] undef &$coderef consistency

$ perl -le' undef &{$x=sub{}}; $x->()'
Not a CODE reference at -e line 1.

undeffing an anonymous subroutine used to turn the ANON flag off,
causing it to bypass the condition apparently written for this situa-
tion in pp_entersub.

This commit stops cv_undef from turning off that flag, so now we get:

$ ./perl -le' undef &{$x=sub{}}; $x->()'
Undefined subroutine called at -e line 1.
pad.c
t/op/anonsub.t