From: Perl 5 Porters <perl5-porters@africa.nicoh.com>
Date: Fri, 5 Jul 1996 05:01:26 +0000 (+0000)
Subject: perl 5.003_01: cop.h
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=03d5e78e23137ad2106be45fc1159128bae29695;p=p5sagit%2Fp5-mst-13.2.git

perl 5.003_01: cop.h

Increment refcount on @_ when passed through to another sub,
so it's not freed twiceon return.
---

diff --git a/cop.h b/cop.h
index b503309..bea47c4 100644
--- a/cop.h
+++ b/cop.h
@@ -52,6 +52,9 @@ struct block_sub {
 	}								\
 	if (cx->blk_sub.cv) {						\
 	    if (!(CvDEPTH(cx->blk_sub.cv) = cx->blk_sub.olddepth)) {	\
+	        if (cx->blk_sub.hasargs) {				\
+	    	    SvREFCNT_inc((SV*)cx->blk_sub.argarray);		\
+		}							\
 		SvREFCNT_dec((SV*)cx->blk_sub.cv);			\
 	    }								\
 	}