AVs and HVs don't have IVXs or NVXs, so assert this too.
Nicholas Clark [Sun, 19 Feb 2006 20:30:24 +0000 (20:30 +0000)]
p4raw-id: //depot/perl@27230

sv.h

diff --git a/sv.h b/sv.h
index ae1c26d..d3ce22f 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -907,16 +907,22 @@ in gv.h: */
 #    define SvIVX(sv)                                                  \
        (*({ SV *const _svi = (SV *) sv;                                \
            assert(SvTYPE(_svi) == SVt_IV || SvTYPE(_svi) >= SVt_PVIV); \
+           assert(SvTYPE(_svi) != SVt_PVAV);                           \
+           assert(SvTYPE(_svi) != SVt_PVHV);                           \
            &(((XPVIV*) SvANY(_svi))->xiv_iv);                          \
         }))
 #    define SvUVX(sv)                                                  \
        (*({ SV *const _svi = (SV *) sv;                                \
            assert(SvTYPE(_svi) == SVt_IV || SvTYPE(_svi) >= SVt_PVIV); \
+           assert(SvTYPE(_svi) != SVt_PVAV);                           \
+           assert(SvTYPE(_svi) != SVt_PVHV);                           \
            &(((XPVUV*) SvANY(_svi))->xuv_uv);                          \
         }))
 #    define SvNVX(sv)                                                  \
        (*({ SV *const _svi = (SV *) sv;                                \
-          assert(SvTYPE(_svi) == SVt_NV || SvTYPE(_svi) >= SVt_PVNV);  \
+           assert(SvTYPE(_svi) == SVt_NV || SvTYPE(_svi) >= SVt_PVNV); \
+           assert(SvTYPE(_svi) != SVt_PVAV);                           \
+           assert(SvTYPE(_svi) != SVt_PVHV);                           \
           &(((XPVNV*) SvANY(_svi))->xnv_nv);                           \
         }))
 #    define SvMAGIC(sv)                                                        \