From: Nicholas Clark Date: Mon, 11 Dec 2006 21:15:06 +0000 (+0000) Subject: Assert that BmRARE() BmPREVIOUS() and BmUSEFUL() are only called on X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=703a10d08f6fbbe216ef6b2375118b8cb03bc1e8;p=p5sagit%2Fp5-mst-13.2.git Assert that BmRARE() BmPREVIOUS() and BmUSEFUL() are only called on valid PVBMs. p4raw-id: //depot/perl@29521 --- diff --git a/sv.h b/sv.h index 379175a..c919e93 100644 --- a/sv.h +++ b/sv.h @@ -1314,17 +1314,20 @@ the scalar's value cannot change unless written to. # define BmRARE(sv) \ (*({ SV *const _svi = (SV *) (sv); \ assert(SvTYPE(_svi) == SVt_PVBM); \ + assert(SvVALID(_svi)); \ &(((XPVBM*) SvANY(_svi))->xbm_rare); \ })) # define BmUSEFUL(sv) \ (*({ SV *const _svi = (SV *) (sv); \ assert(SvTYPE(_svi) == SVt_PVBM); \ + assert(SvVALID(_svi)); \ assert(!SvIOK(_svi)); \ &(((XPVBM*) SvANY(_svi))->xiv_u.xivu_i32); \ })) # define BmPREVIOUS(sv) \ (*({ SV *const _svi = (SV *) (sv); \ assert(SvTYPE(_svi) == SVt_PVBM); \ + assert(SvVALID(_svi)); \ &(((XPVBM*) SvANY(_svi))->xbm_previous); \ })) #else