diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-12-12 21:00:37 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-12-12 21:00:37 +0000 |
commit | 85ffbbb0b9ce8124eef68c3c6234c26ffa9aba18 (patch) | |
tree | 1225fe18b70428d7da3e8776baeef0af8d041bd4 /sv.h | |
parent | 63f10712f341adad800caf833beeb6f5def358fe (diff) | |
download | perl-85ffbbb0b9ce8124eef68c3c6234c26ffa9aba18.tar.gz |
Assert that PVGVs are never SvVALID() in the PVBM sense.
p4raw-id: //depot/perl@29536
Diffstat (limited to 'sv.h')
-rw-r--r-- | sv.h | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -1056,6 +1056,20 @@ the scalar's value cannot change unless written to. #define SvEVALED_off(sv) (SvFLAGS(sv) &= ~SVrepl_EVAL) #if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +# define SvVALID(sv) ({ SV *const thwacke = (SV *) (sv); \ + if (SvFLAGS(thwacke) & SVpbm_VALID) \ + assert(!isGV_with_GP(thwacke)); \ + (SvFLAGS(thwacke) & SVpbm_VALID); \ + }) +# define SvVALID_on(sv) ({ SV *const thwacke = (SV *) (sv); \ + assert(!isGV_with_GP(thwacke)); \ + (SvFLAGS(thwacke) |= SVpbm_VALID); \ + }) +# define SvVALID_off(sv) ({ SV *const thwacke = (SV *) (sv); \ + assert(!isGV_with_GP(thwacke)); \ + (SvFLAGS(thwacke) &= ~SVpbm_VALID); \ + }) + # define SvTAIL(sv) ({ SV *const _svi = (SV *) (sv); \ assert(SvTYPE(_svi) != SVt_PVAV); \ assert(SvTYPE(_svi) != SVt_PVHV); \ @@ -1063,6 +1077,9 @@ the scalar's value cannot change unless written to. == (SVpbm_TAIL|SVpbm_VALID); \ }) #else +# define SvVALID(sv) (SvFLAGS(sv) & SVpbm_VALID) +# define SvVALID_on(sv) (SvFLAGS(sv) |= SVpbm_VALID) +# define SvVALID_off(sv) (SvFLAGS(sv) &= ~SVpbm_VALID) # define SvTAIL(sv) ((SvFLAGS(sv) & (SVpbm_TAIL|SVpbm_VALID)) \ == (SVpbm_TAIL|SVpbm_VALID)) @@ -1070,9 +1087,6 @@ the scalar's value cannot change unless written to. #define SvTAIL_on(sv) (SvFLAGS(sv) |= SVpbm_TAIL) #define SvTAIL_off(sv) (SvFLAGS(sv) &= ~SVpbm_TAIL) -#define SvVALID(sv) (SvFLAGS(sv) & SVpbm_VALID) -#define SvVALID_on(sv) (SvFLAGS(sv) |= SVpbm_VALID) -#define SvVALID_off(sv) (SvFLAGS(sv) &= ~SVpbm_VALID) #ifdef USE_ITHREADS /* The following uses the FAKE flag to show that a regex pointer is infact |