assert that SvMAGIC is never non-NULL for any PVMG used as a pad name.
Nicholas Clark [Fri, 24 Feb 2006 11:21:06 +0000 (11:21 +0000)]
p4raw-id: //depot/perl@27304

sv.h

diff --git a/sv.h b/sv.h
index fdb1fd0..5474074 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -1011,6 +1011,8 @@ in gv.h: */
 #    define SvMAGIC(sv)                                                        \
        (*({ SV *const _svi = (SV *) sv;                                \
            assert(SvTYPE(_svi) >= SVt_PVMG);                           \
+           if (SvTYPE(_svi) == SVt_PVMG && (SvFLAGS(_svi) & SVpad_NAME)) \
+               assert (!((XPVMG*) SvANY(_svi))->xmg_magic); \
            &(((XPVMG*) SvANY(_svi))->xmg_magic);                       \
          }))
 #    define SvSTASH(sv)                                                        \