summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-08-24 22:16:07 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-08-24 22:16:07 -0700
commit2c37437046bfc1b5f46302ce005c170a3bac504b (patch)
tree0742d9a2268f60dc6210cfda54746e9cd87ba8d3 /pad.c
parent73ff03e80797f5abfbbb570cc398cc59078bc6d5 (diff)
downloadperl-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.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/pad.c b/pad.c
index eb88afc32c..4036ddf085 100644
--- a/pad.c
+++ b/pad.c
@@ -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);
}
/*