summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorReini Urban <rurban@x-ray.at>2013-08-27 11:52:28 -0500
committerFather Chrysostomos <sprout@cpan.org>2013-09-03 17:56:49 -0700
commit654c0d3f0e3795c2f964dc3db8cb15bb86bcfa50 (patch)
tree50e8df85476f2e814621fc47a73efef72c48bc3e /sv.h
parent5edbc4ffd619bf985c0d95ab3981022eea5bcc99 (diff)
downloadperl-654c0d3f0e3795c2f964dc3db8cb15bb86bcfa50.tar.gz
[perl #119481] Check SvVALID for !SvSCREAM, skip PAD
SVpad_NAME = SVp_SCREAM|SVpbm_VALID Subsequently OUR, TYPED and STATE pads all have SVp_SCREAM set. SVpad_NAME shares the same bit with SVpbm_VALID, so avoid checking PADs for SVpbm_VALID.
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/sv.h b/sv.h
index 2f0eabc74a..a5c6b25960 100644
--- a/sv.h
+++ b/sv.h
@@ -1081,27 +1081,30 @@ sv_force_normal does nothing.
#if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
# define SvVALID(sv) ({ const SV *const _svvalid = (const SV*)(sv); \
- if (SvFLAGS(_svvalid) & SVpbm_VALID) \
+ if (SvFLAGS(_svvalid) & SVpbm_VALID && !SvSCREAM(_svvalid)) \
assert(!isGV_with_GP(_svvalid)); \
(SvFLAGS(_svvalid) & SVpbm_VALID); \
})
# define SvVALID_on(sv) ({ SV *const _svvalid = MUTABLE_SV(sv); \
assert(!isGV_with_GP(_svvalid)); \
+ assert(!SvSCREAM(_svvalid)); \
(SvFLAGS(_svvalid) |= SVpbm_VALID); \
})
# define SvVALID_off(sv) ({ SV *const _svvalid = MUTABLE_SV(sv); \
assert(!isGV_with_GP(_svvalid)); \
+ assert(!SvSCREAM(_svvalid)); \
(SvFLAGS(_svvalid) &= ~SVpbm_VALID); \
})
# define SvTAIL(sv) ({ const SV *const _svtail = (const SV *)(sv); \
- assert(SvTYPE(_svtail) != SVt_PVAV); \
- assert(SvTYPE(_svtail) != SVt_PVHV); \
+ assert(SvTYPE(_svtail) != SVt_PVAV); \
+ assert(SvTYPE(_svtail) != SVt_PVHV); \
+ assert(!SvSCREAM(_svtail)); \
(SvFLAGS(sv) & (SVpbm_TAIL|SVpbm_VALID)) \
== (SVpbm_TAIL|SVpbm_VALID); \
})
#else
-# define SvVALID(sv) (SvFLAGS(sv) & SVpbm_VALID)
+# define SvVALID(sv) ((SvFLAGS(sv) & SVpbm_VALID) && !SvSCREAM(sv))
# 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)) \