From: Gurusamy Sarathy Date: Thu, 7 Jun 2001 20:01:31 +0000 (+0000) Subject: in change#10451, check that CvOUTSIDE is a CV before looking in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f58d107366fa640961a38c8b8a863f087a6ab3a2;p=p5sagit%2Fp5-mst-13.2.git in change#10451, check that CvOUTSIDE is a CV before looking in (it can apparently be SVt_NULL during global destruction) p4raw-link: @10451 on //depot/maint-5.6/perl: 03f9d59115e90b0796ba7943655c020a829c11bf p4raw-id: //depot/perl@10471 --- diff --git a/op.c b/op.c index 08e2ed4..6e42527 100644 --- a/op.c +++ b/op.c @@ -4180,7 +4180,8 @@ Perl_cv_undef(pTHX_ CV *cv) * apply to closures generated within eval"", since eval"" CVs are * ephemeral. --GSAR */ if (!CvANON(cv) || CvCLONED(cv) - || (CvOUTSIDE(cv) && CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv)))) + || (CvOUTSIDE(cv) && SvTYPE(CvOUTSIDE(cv)) == SVt_PVCV + && CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv)))) { SvREFCNT_dec(CvOUTSIDE(cv)); } @@ -4828,7 +4829,8 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block) * lifetime of the outer CV. Avoids memory leak due to reference * loop. --GSAR */ if (!name && CvOUTSIDE(cv) - && !(CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv)))) + && !(SvTYPE(CvOUTSIDE(cv)) == SVt_PVCV + && CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv)))) { SvREFCNT_dec(CvOUTSIDE(cv)); }