Change 34355 by [EMAIL PROTECTED] on 2008/09/12 08:52:50

        Need to free the isa lookup hash before rebuilding it.

Affected files ...

... //depot/perl/mro.c#51 edit
... //depot/perl/t/op/universal.t#34 edit

Differences ...

==== //depot/perl/mro.c#51 (text) ====
Index: perl/mro.c
--- perl/mro.c#50~34354~        2008-09-11 17:19:51.000000000 -0700
+++ perl/mro.c  2008-09-12 01:52:50.000000000 -0700
@@ -546,6 +546,10 @@
     SvREFCNT_dec((SV*)meta->mro_linear_c3);
     meta->mro_linear_dfs = NULL;
     meta->mro_linear_c3 = NULL;
+    if (meta->isa) {
+       SvREFCNT_dec(meta->isa);
+       meta->isa = NULL;
+    }
 
     /* Inc the package generation, since our @ISA changed */
     meta->pkg_gen++;

==== //depot/perl/t/op/universal.t#34 (xtext) ====
Index: perl/t/op/universal.t
--- perl/t/op/universal.t#33~33697~     2008-04-16 06:15:20.000000000 -0700
+++ perl/t/op/universal.t       2008-09-12 01:52:50.000000000 -0700
@@ -10,7 +10,7 @@
     require "./test.pl";
 }
 
-plan tests => 112;
+plan tests => 116;
 
 $a = {};
 bless $a, "Bob";
@@ -234,3 +234,14 @@
 # http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-05/msg01710.html
 # but never actually tested.
 is(UNIVERSAL->can("NoSuchPackage::foo"), undef);
+
[EMAIL PROTECTED]::ISA = 'zlopp';
+ok (splatt->isa('zlopp'));
+ok (!splatt->isa('plop'));
+
+# This should reset the ->isa lookup cache
[EMAIL PROTECTED]::ISA = 'plop';
+# And here is the new truth.
+ok (!splatt->isa('zlopp'));
+ok (splatt->isa('plop'));
+
End of Patch.

Reply via email to