diff options
author | David Mitchell <davem@iabyn.com> | 2012-03-26 13:31:24 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-03-26 15:00:03 +0100 |
commit | f37f40f4443470b7a9dc16c4549f9074ff36057b (patch) | |
tree | ef2235609b36d7d534ec260dc03532e9949789d6 /sv.c | |
parent | 864db5fdec4230e524b19f1f01b8c8b499458d66 (diff) | |
download | perl-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.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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)); } |