From: Nicholas Clark Date: Wed, 28 Dec 2005 19:40:26 +0000 (+0000) Subject: As the backreferences AV doesn't hold references on its contents, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3d998840fa41946cf8ee609337ef4edea761fd2;p=p5sagit%2Fp5-mst-13.2.git As the backreferences AV doesn't hold references on its contents, surely it should have AvREAL turned off? p4raw-id: //depot/perl@26517 --- diff --git a/sv.c b/sv.c index 3b69cb5..d797a9f 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;