summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-04-25 22:58:27 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-04-25 22:58:27 +0000
commit0dd88869d3c6272dc66f202c5be0f40bfb94fccd (patch)
tree0d0ebfbf7b95ec087f836814f4c10e149b04bfc0 /pp.c
parent18a945d476bb4c5319db42e3585c9617c125cba5 (diff)
downloadperl-0dd88869d3c6272dc66f202c5be0f40bfb94fccd.tar.gz
fix buggy reference count on refs to SVs with autoviv magic
(resulted in C<my @a; $a[1] = 1; print \$_ for @a> and Data::Dumper accessing free()d memory) p4raw-id: //depot/perl@3270
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pp.c b/pp.c
index 8c48574493..e6a2e1195e 100644
--- a/pp.c
+++ b/pp.c
@@ -512,6 +512,8 @@ refto(SV *sv)
vivify_defelem(sv);
if (!(sv = LvTARG(sv)))
sv = &PL_sv_undef;
+ else
+ SvREFCNT_inc(sv);
}
else if (SvPADTMP(sv))
sv = newSVsv(sv);