When resetting our children, wipe out the isa cache too.
authorNicholas Clark <nick@ccl4.org>
Sat, 25 Jul 2009 16:04:29 +0000 (17:04 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sat, 25 Jul 2009 22:13:51 +0000 (23:13 +0100)
(Fix to change 34354, which introduced a cached hash to make ->isa O(1))

(cherry picked from commit 1375cf1cf2085f851bb176047d5e60248542f555)

mro.c

diff --git a/mro.c b/mro.c
index b095d24..5c049f6 100644 (file)
--- a/mro.c
+++ b/mro.c
@@ -437,7 +437,7 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash)
     if(meta->mro_nextmethod) hv_clear(meta->mro_nextmethod);
 
     /* Iterate the isarev (classes that are our children),
-       wiping out their linearization and method caches */
+       wiping out their linearization, method and isa caches */
     if(isarev) {
         hv_iterinit(isarev);
         while((iter = hv_iternext(isarev))) {
@@ -462,6 +462,10 @@ Perl_mro_isa_changed_in(pTHX_ HV* stash)
                 revmeta->cache_gen++;
             if(revmeta->mro_nextmethod)
                 hv_clear(revmeta->mro_nextmethod);
+           if (revmeta->isa) {
+               SvREFCNT_dec(revmeta->isa);
+               revmeta->isa = NULL;
+           }
         }
     }