summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-09-18 18:01:37 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-09-18 18:01:37 +0000
commit8bb77e1d87aec5c3f7c4bf32f677921213e0f7bd (patch)
treef7bde236f2c1e451fefb8b9fca0fdf7a4530f779 /cop.h
parent0f61463b175e361f082ecc967a3f67bf2fb0e62d (diff)
downloadperl-8bb77e1d87aec5c3f7c4bf32f677921213e0f7bd.tar.gz
delay freeing itervar so C<for $i (@a) { return($i) }> works
p4raw-id: //depot/perl@1789
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/cop.h b/cop.h
index 4d020196cd..f15b1e125d 100644
--- a/cop.h
+++ b/cop.h
@@ -143,7 +143,7 @@ struct block_loop {
#define POPLOOP2() \
SvREFCNT_dec(cxloop.iterlval); \
if (cxloop.itervar) { \
- SvREFCNT_dec(*cxloop.itervar); \
+ sv_2mortal(*cxloop.itervar); \
*cxloop.itervar = cxloop.itersave; \
} \
if (cxloop.iterary && cxloop.iterary != PL_curstack) \