This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
First stab at using the pad to store the serialised hints data.
[perl5.git] / util.c
diff --git a/util.c b/util.c
index 4022bb0..b4ed7f2 100644 (file)
--- a/util.c
+++ b/util.c
@@ -99,7 +99,7 @@ Perl_safesysmalloc(MEM_SIZE size)
 #endif
 
 #ifdef PERL_POISON
-       Poison(((char *)ptr), size, char);
+       PoisonNew(((char *)ptr), size, char);
 #endif
 
 #ifdef PERL_TRACK_MEMPOOL
@@ -165,7 +165,7 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
        if (header->size > size) {
            const MEM_SIZE freed_up = header->size - size;
            char *start_of_freed = ((char *)where) + size;
-           Poison(start_of_freed, freed_up, char);
+           PoisonFree(start_of_freed, freed_up, char);
        }
        header->size = size;
 #  endif
@@ -190,7 +190,7 @@ Perl_safesysrealloc(Malloc_t where,MEM_SIZE size)
        if (header->size < size) {
            const MEM_SIZE fresh = size - header->size;
            char *start_of_fresh = ((char *)ptr) + size;
-           Poison(start_of_fresh, fresh, char);
+           PoisonNew(start_of_fresh, fresh, char);
        }
 #  endif
 
@@ -241,7 +241,7 @@ Perl_safesysfree(Malloc_t where)
            header->next->prev = header->prev;
            header->prev->next = header->next;
 #  ifdef PERL_POISON
-           Poison(where, header->size, char);
+           PoisonNew(where, header->size, char);
 #  endif
            /* Trigger the duplicate free warning.  */
            header->next = NULL;
@@ -3419,6 +3419,7 @@ Perl_report_evil_fh(pTHX_ const GV *gv, const IO *io, I32 op)
     const char * const func =
        op == OP_READLINE   ? "readline"  :     /* "<HANDLE>" not nice */
        op == OP_LEAVEWRITE ? "write" :         /* "write exit" not nice */
+       op < 0              ? "" :              /* handle phoney cases */
        PL_op_desc[op];
     const char * const pars = OP_IS_FILETEST(op) ? "" : "()";
     const char * const type = OP_IS_SOCKET(op)