summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-09-06 20:32:47 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-15 22:45:08 -0700
commitebfebee40d0932ec522c6781a1405d871fab3ca1 (patch)
treee20c37cc4ccd4f4259458c00f76cde82d447d3f5 /pad.c
parentcf748c3cf2f8037fd170d42f370bc36a48de92ad (diff)
downloadperl-ebfebee40d0932ec522c6781a1405d871fab3ca1.tar.gz
Use the same outside logic for mysubs and formats
By using find_runcv_where both for formats and my subs nested in inner clonable subs, we can simplify the code. It happens to make this work ($x is visible): use 5.01; sub not_lexical8 { my sub foo; foo(); sub not_lexical9 { my sub bar { my $x = 'khaki car keys for the khaki car'; not_lexical8(); sub foo { warn $x } } bar() } } not_lexical9(); This is definitely iffy code, but if making it work makes the imple- mentation simpler, so why not?
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/pad.c b/pad.c
index 03cb555379..85aeea51fe 100644
--- a/pad.c
+++ b/pad.c
@@ -1985,18 +1985,8 @@ S_cv_clone_pad(pTHX_ CV *proto, CV *cv, CV *outside)
*/
if (!outside) {
- if (SvTYPE(proto) == SVt_PVCV)
- {
+ if (CvWEAKOUTSIDE(proto))
outside = find_runcv(NULL);
- if (!CvANON(proto)) {
- if (!CvPADLIST(outside) ||
- CvPADLIST(outside)->xpadl_id != protopadlist->xpadl_outid)
- outside = CvOUTSIDE(proto);
- if (!CvPADLIST(outside) ||
- CvPADLIST(outside)->xpadl_id != protopadlist->xpadl_outid)
- outside = NULL;
- }
- }
else {
outside = CvOUTSIDE(proto);
if ((CvCLONE(outside) && ! CvCLONED(outside))