save_delete(), err, SAVEDELETE() fixes from Charles Lane.
Jarkko Hietaniemi [Tue, 9 Jan 2001 21:06:08 +0000 (21:06 +0000)]
Should finish up the bug id 20001205.022.

p4raw-id: //depot/perl@8382

pp.c
pp_hot.c
scope.c

diff --git a/pp.c b/pp.c
index f970cde..2d49cf1 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -3545,7 +3545,7 @@ PP(pp_hslice)
                    else {
                        STRLEN keylen;
                        char *key = SvPV(keysv, keylen);
-                       save_delete(hv, key, keylen);
+                       SAVEDELETE(hv, savepvn(key,keylen), keylen);
                    }
                 }
            }
index 30cc61d..df66647 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1577,7 +1577,7 @@ PP(pp_helem)
                if (!preeminent) {
                    STRLEN keylen;
                    char *key = SvPV(keysv, keylen);
-                   save_delete(hv, key, keylen);
+                   SAVEDELETE(hv, savepvn(key,keylen), keylen);
                } else
                    save_helem(hv, keysv, svp);
             }
diff --git a/scope.c b/scope.c
index d4ea391..5275935 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -852,7 +852,7 @@ Perl_leave_scope(pTHX_ I32 base)
            ptr = SSPOPPTR;
            (void)hv_delete(hv, (char*)ptr, (U32)SSPOPINT, G_DISCARD);
            SvREFCNT_dec(hv);
-           /* Safefree(ptr); */ /* Does not work with shared strings. */
+           Safefree(ptr); 
            break;
        case SAVEt_DESTRUCTOR:
            ptr = SSPOPPTR;