From f37f40f4443470b7a9dc16c4549f9074ff36057b Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Mon, 26 Mar 2012 13:31:24 +0100 Subject: clear magic flags in sv_clear commit 5bec93bead1c10563a402404de095bbdf398790f made temporary use of the no-longer used SvMAGIC field while freeing a HV. This commit makes sure that before this happens, that the SvMAGICAL flags are turned off. This is because it turns out that some XS code (e.g. Glib) can leave an SV with a null SvMAGIC field, but with magic flags still set. --- sv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sv.c b/sv.c index 40f8d1d696..3ac2fd8d3e 100644 --- a/sv.c +++ b/sv.c @@ -6056,6 +6056,7 @@ Perl_sv_clear(pTHX_ SV *const orig_sv) sv_unmagic(sv, PERL_MAGIC_backref); mg_free(sv); } + SvMAGICAL_off(sv); if (type == SVt_PVMG && SvPAD_TYPED(sv)) SvREFCNT_dec(SvSTASH(sv)); } -- cgit v1.2.1