summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-11-14 22:31:14 +0000
committerNicholas Clark <nick@ccl4.org>2005-11-14 22:31:14 +0000
commit0565a181ab920bd3cc76f2ab45d62768abfcaf8d (patch)
tree3bef6b0b82a543d722fd1ad8d544c18184053a02 /sv.h
parent80002e0d612c016105daaa578514ef1b726842f4 (diff)
downloadperl-0565a181ab920bd3cc76f2ab45d62768abfcaf8d.tar.gz
Mark all places where perl needs to look at a possibly-freed scalar
with a macro SvIS_FREED(sv) p4raw-id: //depot/perl@26132
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/sv.h b/sv.h
index 99cfe5a7b2..f5a3125649 100644
--- a/sv.h
+++ b/sv.h
@@ -185,6 +185,11 @@ perform the upgrade if necessary. See C<svtype>.
#define SVTYPEMASK 0xff
#define SvTYPE(sv) ((sv)->sv_flags & SVTYPEMASK)
+/* Sadly there are some parts of the core that have pointers to already-freed
+ SV heads, and rely on being able to tell that they are now free. So mark
+ them all by using a consistent macro. */
+#define SvIS_FREED(sv) ((sv)->sv_flags == SVTYPEMASK)
+
#define SvUPGRADE(sv, mt) (SvTYPE(sv) >= (mt) || (sv_upgrade(sv, mt), 1))
#define SVs_PADSTALE 0x00000100 /* lexical has gone out of scope */