summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-03-26 13:31:24 +0100
committerDavid Mitchell <davem@iabyn.com>2012-03-26 15:00:03 +0100
commitf37f40f4443470b7a9dc16c4549f9074ff36057b (patch)
treeef2235609b36d7d534ec260dc03532e9949789d6 /sv.c
parent864db5fdec4230e524b19f1f01b8c8b499458d66 (diff)
downloadperl-f37f40f4443470b7a9dc16c4549f9074ff36057b.tar.gz
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.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c1
1 files changed, 1 insertions, 0 deletions
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));
}