Subject: | [PATCH] Weaken magic gets corrupted |
I often see error messages like the following after running
Devel::FindRef::track:
panic: magic_killbackrefs (flags=ff).
Devel::Peek::Dump was showing two backref(<) magic records for some
SVs, and I realized this was happening because of calling sv_rvweaken
while RMAGICAL was turned off.
The attached patch fixes it.
Subject: | Devel-FindRef.magic.patch |
--- Devel-FindRef-1.1/FindRef.xs 2007-12-29 15:53:16.000000000 -0500
+++ Devel-FindRef-1.1-mod/FindRef.xs 2008-04-24 17:25:53.000000000 -0400
@@ -16,7 +16,9 @@
{ \
AV *av = newAV (); \
av_push (av, newSVpv (text, 0)); \
+ if (rmagical) SvRMAGICAL_on (sv); \
av_push (av, sv_rvweaken (newRV_inc (sv))); \
+ if (rmagical) SvRMAGICAL_off (sv); \
av_push (about, newRV_noinc ((SV *)av)); \
}