summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-15 15:53:31 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-15 16:47:50 -0700
commitb7acb0a30ed43df67095edb94273785a03b4d989 (patch)
tree9d16f30ff26b773f5013ac60e666dd81f4544187 /pp.c
parent0c028dca83ca08aba6b78a65e979163e4a779bf8 (diff)
downloadperl-b7acb0a30ed43df67095edb94273785a03b4d989.tar.gz
Stop undef &foo from temporarily anonymising
Instead of setting aside the name, calling cv_undef, and then naming the sub anew, just pass a flag to tell cv_undef not to unname it.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/pp.c b/pp.c
index 0750ea027b..547731f302 100644
--- a/pp.c
+++ b/pp.c
@@ -1001,19 +1001,8 @@ PP(pp_undef)
));
/* FALLTHROUGH */
case SVt_PVFM:
- {
/* let user-undef'd sub keep its identity */
- GV* const gv = CvGV((const CV *)sv);
- HEK * const hek = CvNAME_HEK((CV *)sv);
- if (hek) share_hek_hek(hek);
- if (gv) SvREFCNT_inc_void_NN(sv_2mortal((SV *)gv));
- cv_undef(MUTABLE_CV(sv));
- if (gv) CvGV_set(MUTABLE_CV(sv), gv);
- else if (hek) {
- SvANY((CV *)sv)->xcv_gv_u.xcv_hek = hek;
- CvNAMED_on(sv);
- }
- }
+ cv_undef_flags(MUTABLE_CV(sv), CV_UNDEF_KEEP_NAME);
break;
case SVt_PVGV:
assert(isGV_with_GP(sv));