From: Zefram Date: Tue, 27 Aug 2013 14:57:35 +0000 (+0100) Subject: wrong test for magicalness X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ad06a65004e9646ccce249df1783cc23f441f946;p=p5sagit%2FDevel-Size.git wrong test for magicalness Devel::Size looks at the SvMAGIC pointer for any SV that's SVt_PVMG or above. This is incorrect. It is actually necessary (and sufficient) to check the SvMAGICAL flag. Attached patch fixes. --- diff --git a/Size.xs b/Size.xs index 05e540a..109dd15 100644 --- a/Size.xs +++ b/Size.xs @@ -707,7 +707,7 @@ sv_size(pTHX_ struct state *const st, const SV * const orig_thing, } st->total_size += sizeof(SV) + body_sizes[type]; - if (type >= SVt_PVMG) { + if (SvMAGICAL(thing)) { magic_size(aTHX_ thing, st); }