summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-04-03 10:03:18 +1200
committerChip Salzenberg <chip@atlantic.net>1997-04-03 10:03:25 +1200
commit09280a334577a8254c4115b822e1f8cc667611a1 (patch)
tree5248ec052bcee25ef7a4efc61f20a99d7e7a04e8 /pp.c
parent8523fd8370f87f8e7cc44b73b86edff69f32270d (diff)
downloadperl-09280a334577a8254c4115b822e1f8cc667611a1.tar.gz
Fix AUTOLOAD, or kill me
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pp.c b/pp.c
index 84b393bfdb..357f91e5ff 100644
--- a/pp.c
+++ b/pp.c
@@ -557,7 +557,9 @@ PP(pp_undef)
CvANON((CV*)sv) ? "(anonymous)" : GvENAME(CvGV((CV*)sv)));
/* FALL THROUGH */
case SVt_PVFM:
- cv_undef((CV*)sv);
+ { GV* gv = (GV*)SvREFCNT_inc(CvGV((CV*)sv));
+ cv_undef((CV*)sv);
+ CvGV((CV*)sv) = gv; } /* let user-undef'd sub keep its identity */
break;
case SVt_PVGV:
if (SvFAKE(sv))