Change 26112 by [EMAIL PROTECTED] on 2005/11/13 18:47:27

        Fix breakages that prevended -DPERL_POISON from compiling.

Affected files ...

... //depot/perl/handy.h#105 edit
... //depot/perl/sv.h#223 edit

Differences ...

==== //depot/perl/handy.h#105 (text) ====
Index: perl/handy.h
--- perl/handy.h#104~25941~     Mon Oct 31 14:15:01 2005
+++ perl/handy.h        Sun Nov 13 10:47:27 2005
@@ -713,7 +713,7 @@
 
 #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

==== //depot/perl/sv.h#223 (text) ====
Index: perl/sv.h
--- perl/sv.h#222~25885~        Sat Oct 29 10:21:24 2005
+++ perl/sv.h   Sun Nov 13 10:47:27 2005
@@ -896,10 +896,17 @@
 #  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)
End of Patch.

Reply via email to