diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-08-24 22:16:07 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-08-24 22:16:07 -0700 |
commit | 2c37437046bfc1b5f46302ce005c170a3bac504b (patch) | |
tree | 0742d9a2268f60dc6210cfda54746e9cd87ba8d3 /pad.c | |
parent | 73ff03e80797f5abfbbb570cc398cc59078bc6d5 (diff) | |
download | perl-2c37437046bfc1b5f46302ce005c170a3bac504b.tar.gz |
[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.
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -463,8 +463,9 @@ Perl_cv_undef(pTHX_ CV *cv) CvXSUB(cv) = NULL; } /* delete all flags except WEAKOUTSIDE and CVGV_RC, which indicate the - * ref status of CvOUTSIDE and CvGV */ - CvFLAGS(cv) &= (CVf_WEAKOUTSIDE|CVf_CVGV_RC); + * ref status of CvOUTSIDE and CvGV, and ANON, which pp_entersub uses + * to choose an error message */ + CvFLAGS(cv) &= (CVf_WEAKOUTSIDE|CVf_CVGV_RC|CVf_ANON); } /* |