summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2001-06-07 20:01:31 +0000
committerGurusamy Sarathy <gsar@cpan.org>2001-06-07 20:01:31 +0000
commitf58d107366fa640961a38c8b8a863f087a6ab3a2 (patch)
tree3275514f30da57fd7d759ec059db42c14a6cfe0b /op.c
parent5cd5c4227e98c1aba00f926c07010f476cdbbf55 (diff)
downloadperl-f58d107366fa640961a38c8b8a863f087a6ab3a2.tar.gz
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
Diffstat (limited to 'op.c')
-rw-r--r--op.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/op.c b/op.c
index 08e2ed4727..6e4252781f 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));
}