This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
assert that you aren't assigning to the NVX of an AV or HV
[perl5.git] / sv.h
diff --git a/sv.h b/sv.h
index e6aea8d..0835ccd 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -941,6 +941,7 @@ in gv.h: */
                (((XPVIV*)  SvANY(sv))->xiv_iv = (val)); } STMT_END
 #define SvNV_set(sv, val) \
        STMT_START { assert(SvTYPE(sv) == SVt_NV || SvTYPE(sv) >= SVt_PVNV); \
+           assert(SvTYPE(sv) != SVt_PVAV); assert(SvTYPE(sv) != SVt_PVHV); \
                (((XPVNV*)SvANY(sv))->xnv_nv = (val)); } STMT_END
 #define SvPV_set(sv, val) \
        STMT_START { assert(SvTYPE(sv) >= SVt_PV); \