This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make mro_package_moved use a mortal in case mro_isa_changed_in3 croaks
authorFather Chrysostomos <sprout@cpan.org>
Sun, 24 Oct 2010 17:42:33 +0000 (10:42 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 24 Oct 2010 17:42:52 +0000 (10:42 -0700)
mro.c

diff --git a/mro.c b/mro.c
index b065d70..8fe6b20 100644 (file)
--- a/mro.c
+++ b/mro.c
@@ -631,7 +631,7 @@ Perl_mro_package_moved(pTHX_ HV * const stash, const HV * const oldstash,
     /* Skip the entire loop if the hash is empty.   */
     if(oldstash && HvUSEDKEYS(oldstash)) { 
        xhv = (XPVHV*)SvANY(oldstash);
-       seen = newHV();
+       seen = (HV *) sv_2mortal((SV *)newHV());
 
        /* Iterate through entries in the oldstash, calling
            mro_package_moved(
@@ -734,7 +734,6 @@ Perl_mro_package_moved(pTHX_ HV * const stash, const HV * const oldstash,
        }
     }
 
-    if(seen) SvREFCNT_dec((SV *)seen);
 }
 
 /*