Two Safefree() changes to make -DPERL_POISON builds work again.
authorGeorge Greer <perl@greerga.m-l.org>
Sun, 6 Feb 2011 16:47:21 +0000 (11:47 -0500)
committerGeorge Greer <perl@greerga.m-l.org>
Sun, 6 Feb 2011 16:47:21 +0000 (11:47 -0500)
The poison exposes a failure in t/op/magic:

    panic: corrupt saved stack index at - line 6.
    FAILED at test 7

gv.c
regcomp.c

diff --git a/gv.c b/gv.c
index 56f7df6..9a259e0 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -1085,7 +1085,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
                        GvMULTI_on(gv);
                }
                if (key != name)
-                   Safefree((char *)key);
+                   Safefree(key);
                if (!gv || gv == (const GV *)&PL_sv_undef)
                    return NULL;
 
index 5a50c5a..baa0813 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -5819,7 +5819,8 @@ S_invlist_destroy(pTHX_ HV* const invlist)
     PERL_ARGS_ASSERT_INVLIST_DESTROY;
 
     if (list_ptr != NULL) {
-       Safefree(INT2PTR(UV *, SvUV(*list_ptr)));
+       UV *list = INT2PTR(UV *, SvUV(*list_ptr)); /* PERL_POISON needs lvalue */
+       Safefree(list);
     }
 }