From: Nicholas Clark Date: Fri, 8 Dec 2006 23:22:31 +0000 (+0000) Subject: assert that SvTAIL() isn't being called on PVAVs or PVHVs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=85efc3a51ca0ee5724a80b554624140f51d5305c;p=p5sagit%2Fp5-mst-13.2.git assert that SvTAIL() isn't being called on PVAVs or PVHVs p4raw-id: //depot/perl@29491 --- diff --git a/sv.h b/sv.h index 4ec96e8..054ec6b 100644 --- a/sv.h +++ b/sv.h @@ -349,7 +349,7 @@ perform the upgrade if necessary. See C. #define SVpav_REAL 0x40000000 /* free old entries */ /* PVHV */ #define SVphv_LAZYDEL 0x40000000 /* entry in xhv_eiter must be deleted */ -/* PVBM */ +/* Not just PVBM - basically anything that can be a regular scalar */ #define SVpbm_TAIL 0x40000000 /* ??? */ #define SVrepl_EVAL 0x40000000 /* Replacement part of s///e */ @@ -1059,7 +1059,15 @@ the scalar's value cannot change unless written to. #define SvEVALED_on(sv) (SvFLAGS(sv) |= SVrepl_EVAL) #define SvEVALED_off(sv) (SvFLAGS(sv) &= ~SVrepl_EVAL) -#define SvTAIL(sv) (SvFLAGS(sv) & SVpbm_TAIL) +#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +# define SvTAIL(sv) ({ SV *const _svi = (SV *) (sv); \ + assert(SvTYPE(_svi) != SVt_PVAV); \ + assert(SvTYPE(_svi) != SVt_PVHV); \ + SvFLAGS(sv) & SVpbm_TAIL; \ + }) +#else +# define SvTAIL(sv) (SvFLAGS(sv) & SVpbm_TAIL) +#endif #define SvTAIL_on(sv) (SvFLAGS(sv) |= SVpbm_TAIL) #define SvTAIL_off(sv) (SvFLAGS(sv) &= ~SVpbm_TAIL)