From: Florian Ragwitz Date: Sun, 30 Sep 2012 07:48:30 +0000 (+0900) Subject: Only attempt to count magic on magical SVs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b78233367a68bbecf494529e5b22e083a61052c;p=p5sagit%2FDevel-Size.git Only attempt to count magic on magical SVs XPVMGs might not have a MAGIC* chain attached. SvMAGICAL is the predicate for that. --- diff --git a/Memory.xs b/Memory.xs index 52a92b5..a111755 100644 --- a/Memory.xs +++ b/Memory.xs @@ -638,18 +638,7 @@ cc_opclass(const OP * const o) static void magic_size(pTHX_ const SV * const thing, struct state *st, pPATH) { dNPathNodes(1, NPathArg); - MAGIC *magic_pointer = SvMAGIC(thing); - - if (!magic_pointer) - return; - - if (!SvMAGICAL(thing)) { - if (0) { - warn("Ignoring suspect magic on this SV\n"); - sv_dump((SV*)thing); - } - return; - } + MAGIC *magic_pointer = SvMAGIC(thing); /* caller ensures thing is SvMAGICAL */ /* push a dummy node for NPathSetNode to update inside the while loop */ NPathPushNode("dummy", NPtype_NAME); @@ -1280,6 +1269,7 @@ else warn("skipped suspect HeVAL %p", HeVAL(cur_entry)); } if (type >= SVt_PVMG) { + if (SvMAGICAL(thing)) magic_size(aTHX_ thing, st, NPathLink("MG")); }