#ifdef PERL_POISON
#define Safefree(d) \
- ((d) ? (void)(safefree(MEM_LOG_FREE((Malloc_t)(d)))), Poison(&(d), 1, Malloc_t)) : (void) 0)
+ ((d) ? (void)(safefree(MEM_LOG_FREE((Malloc_t)(d))), Poison(&(d), 1, Malloc_t)) : (void) 0)
#else
#define Safefree(d) safefree(MEM_LOG_FREE((Malloc_t)(d)))
#endif
# 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)