Set the right flags on the renamed CVs
gfx [Mon, 31 Aug 2009 02:29:49 +0000 (11:29 +0900)]
Once they're named, they're not ANON anymore. Also we added magic for
refcounting GVs to them, so they're MAGICAL as well.

Name.xs

diff --git a/Name.xs b/Name.xs
index f2c7903..f6d7bc2 100644 (file)
--- a/Name.xs
+++ b/Name.xs
@@ -81,6 +81,8 @@ subname(name, sub)
                SvREFCNT_dec(mg->mg_obj);
        mg->mg_flags |= MGf_REFCOUNTED;
        mg->mg_obj = (SV *) gv;
+       SvRMAGICAL_on(cv);
+       CvANON_off(cv);
 #ifndef CvGV_set
        CvGV(cv) = gv;
 #else