summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-11-13 18:47:27 +0000
committerNicholas Clark <nick@ccl4.org>2005-11-13 18:47:27 +0000
commit06c0cc96ebd866767a6d107ed78967600f7e0395 (patch)
tree1ebb88815a5ae73c7218f8ed3732983b731433a6 /sv.h
parent678f9f8e69283f64dcdcd30e3fe602110d10a5a6 (diff)
downloadperl-06c0cc96ebd866767a6d107ed78967600f7e0395.tar.gz
Fix breakages that prevended -DPERL_POISON from compiling.
p4raw-id: //depot/perl@26112
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/sv.h b/sv.h
index fc8729f634..99cfe5a7b2 100644
--- a/sv.h
+++ b/sv.h
@@ -896,10 +896,17 @@ in gv.h: */
# endif
#endif
+#ifndef PERL_POISON
/* Given that these two are new, there can't be any existing code using them
* as LVALUEs */
-#define SvPVX_mutable(sv) (0 + (sv)->sv_u.svu_pv)
-#define SvPVX_const(sv) ((const char*)(0 + (sv)->sv_u.svu_pv))
+# define SvPVX_mutable(sv) (0 + (sv)->sv_u.svu_pv)
+# define SvPVX_const(sv) ((const char*)(0 + (sv)->sv_u.svu_pv))
+#else
+/* Except for the poison code, which uses & to scribble over the pointer after
+ free() is called. */
+# define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
+# define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
+#endif
#define SvIVXx(sv) SvIVX(sv)
#define SvUVXx(sv) SvUVX(sv)