summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-12-28 19:40:26 +0000
committerNicholas Clark <nick@ccl4.org>2005-12-28 19:40:26 +0000
commite3d998840fa41946cf8ee609337ef4edea761fd2 (patch)
treeddaa2caa42b583a01133c1ab9ebd406aebfc5929 /sv.c
parente92fe45ca3d43fcecf4a99c92c2f56c28510dc64 (diff)
downloadperl-e3d998840fa41946cf8ee609337ef4edea761fd2.tar.gz
As the backreferences AV doesn't hold references on its contents,
surely it should have AvREAL turned off? p4raw-id: //depot/perl@26517
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sv.c b/sv.c
index 3b69cb5f1a..d797a9fa7c 100644
--- a/sv.c
+++ b/sv.c
@@ -4355,6 +4355,7 @@ Perl_sv_add_backref(pTHX_ SV *tsv, SV *sv)
av = (AV*)mg->mg_obj;
else {
av = newAV();
+ AvREAL_off(av);
sv_magic(tsv, (SV*)av, PERL_MAGIC_backref, NULL, 0);
/* av now has a refcnt of 2, which avoids it getting freed
* before us during global cleanup. The extra ref is removed
@@ -8997,6 +8998,7 @@ Perl_mg_dup(pTHX_ MAGIC *mg, CLONE_PARAMS* param)
SV **svp;
I32 i;
(void)SvREFCNT_inc(nmg->mg_obj = (SV*)newAV());
+ AvREAL_off((AV*)nmg->mg_obj);
svp = AvARRAY(av);
for (i = AvFILLp(av); i >= 0; i--) {
if (!svp[i]) continue;