summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-06-23 12:06:11 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-06-23 12:06:11 -0700
commitbdbfc51a7bc15a2f0a187c1ef09a16838a4c9915 (patch)
treed19609ab2341d791281ead3df2f3e72d8d04d84b /pp.c
parent7b3b090481956031f1fcd4f2190cb437c9bbe815 (diff)
downloadperl-bdbfc51a7bc15a2f0a187c1ef09a16838a4c9915.tar.gz
Stop undef &foo from crashing on lex subs
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 77a9f01653..f8a31e2cae 100644
--- a/pp.c
+++ b/pp.c
@@ -973,7 +973,12 @@ PP(pp_undef)
"Constant subroutine %"SVf" undefined",
SVfARG(CvANON((const CV *)sv)
? newSVpvs_flags("(anonymous)", SVs_TEMP)
- : sv_2mortal(newSVhek(GvENAME_HEK(CvGV((const CV *)sv))))));
+ : sv_2mortal(newSVhek(
+ CvNAMED(sv)
+ ? CvNAME_HEK((CV *)sv)
+ : GvENAME_HEK(CvGV((const CV *)sv))
+ ))
+ ));
/* FALLTHROUGH */
case SVt_PVFM:
{