diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2002-11-24 22:19:06 +0000 |
---|---|---|
committer | hv <hv@crypt.org> | 2002-12-02 00:58:54 +0000 |
commit | d1a83f030cf005cf24000e51c35cae0c98fcbbc7 (patch) | |
tree | 414f284613a099a7fc5dde52837c3e0f3601fc59 /op.c | |
parent | 24200fce502d064473a22e682c66d01118d76507 (diff) | |
download | perl-d1a83f030cf005cf24000e51c35cae0c98fcbbc7.tar.gz |
allow evals to see the full lexical scope
Message-ID: <20021124221906.A25386@fdgroup.com>
p4raw-id: //depot/perl@18220
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -3756,7 +3756,6 @@ Perl_newLOOPEX(pTHX_ I32 type, OP *label) void Perl_cv_undef(pTHX_ CV *cv) { - CV *outsidecv; CV *freecv = Nullcv; #ifdef USE_ITHREADS @@ -3780,20 +3779,21 @@ Perl_cv_undef(pTHX_ CV *cv) } SvPOK_off((SV*)cv); /* forget prototype */ CvGV(cv) = Nullgv; - outsidecv = CvOUTSIDE(cv); + + pad_undef(cv); + /* Since closure prototypes have the same lifetime as the containing * CV, they don't hold a refcount on the outside CV. This avoids * the refcount loop between the outer CV (which keeps a refcount to * the closure prototype in the pad entry for pp_anoncode()) and the * closure prototype, and the ensuing memory leak. --GSAR */ if (!CvANON(cv) || CvCLONED(cv)) - freecv = outsidecv; + freecv = CvOUTSIDE(cv); CvOUTSIDE(cv) = Nullcv; if (CvCONST(cv)) { SvREFCNT_dec((SV*)CvXSUBANY(cv).any_ptr); CvCONST_off(cv); } - pad_undef(cv, outsidecv); if (freecv) SvREFCNT_dec(freecv); if (CvXSUB(cv)) { @@ -4086,9 +4086,11 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) SAVEFREESV(PL_compcv); goto done; } + /* transfer PL_compcv to cv */ cv_undef(cv); CvFLAGS(cv) = CvFLAGS(PL_compcv); CvOUTSIDE(cv) = CvOUTSIDE(PL_compcv); + CvOUTSIDE_SEQ(cv) = CvOUTSIDE_SEQ(PL_compcv); CvOUTSIDE(PL_compcv) = 0; CvPADLIST(cv) = CvPADLIST(PL_compcv); CvPADLIST(PL_compcv) = 0; |