From: David Mitchell Date: Tue, 3 May 2011 16:16:29 +0000 (+0100) Subject: HV backrefs: another simplification X-Git-Tag: accepted/trunk/20130322.191538~4156 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f350200ecf1b0467f7149472cc5aeee9c4d176d1;p=platform%2Fupstream%2Fperl.git HV backrefs: another simplification Now that HV backrefs are only stored in HvAUX, don't go looking for them in magic too in sv_clear() --- diff --git a/sv.c b/sv.c index 534638c..8a66317 100644 --- a/sv.c +++ b/sv.c @@ -6054,9 +6054,12 @@ Perl_sv_clear(pTHX_ SV *const orig_sv) if (type >= SVt_PVMG) { /* Free back-references before magic, in case the magic calls * Perl code that has weak references to sv. */ - if (type == SVt_PVHV) + if (type == SVt_PVHV) { Perl_hv_kill_backrefs(aTHX_ MUTABLE_HV(sv)); - if (type == SVt_PVMG && SvPAD_OUR(sv)) { + if (SvMAGIC(sv)) + mg_free(sv); + } + else if (type == SVt_PVMG && SvPAD_OUR(sv)) { SvREFCNT_dec(SvOURSTASH(sv)); } else if (SvMAGIC(sv)) { /* Free back-references before other types of magic. */