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
authorNicholas Clark <nick@ccl4.org>
Wed, 15 Jun 2005 22:30:53 +0000 (22:30 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 15 Jun 2005 22:30:53 +0000 (22:30 +0000)
p4raw-id: //depot/perl@24857

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); \