summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@atlantic.net>1996-12-26 13:07:14 +1200
committerChip Salzenberg <chip@atlantic.net>1996-12-28 06:22:00 +1200
commit07055b4c536e012d70aa7099a086192fbb14e918 (patch)
tree3e0a87f4a64a30f336a29f23aba7fd2aac1b1e58 /pp.c
parent39035d0c756b3e78a63763b830ba26854e6124f8 (diff)
downloadperl-07055b4c536e012d70aa7099a086192fbb14e918.tar.gz
Support named closures
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/pp.c b/pp.c
index e071ee3c07..db4276e5a1 100644
--- a/pp.c
+++ b/pp.c
@@ -248,8 +248,11 @@ PP(pp_rv2cv)
/* We usually try to add a non-existent subroutine in case of AUTOLOAD. */
/* (But not in defined().) */
CV *cv = sv_2cv(TOPs, &stash, &gv, !(op->op_flags & OPf_SPECIAL));
-
- if (!cv)
+ if (cv) {
+ if (CvCLONE(cv))
+ cv = (CV*)sv_2mortal((SV*)cv_clone(cv));
+ }
+ else
cv = (CV*)&sv_undef;
SETs((SV*)cv);
RETURN;