Change 29336 by [EMAIL PROTECTED] on 2006/11/21 14:45:19

        Invalidate the method lookup cache when assigning to a glob
        named "isa". (That happens when importing "isa" from UNIVERSAL,
        for example.) Fixes bug #24824.

Affected files ...

... //depot/perl/pp_hot.c#483 edit
... //depot/perl/t/op/universal.t#30 edit

Differences ...

==== //depot/perl/pp_hot.c#483 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#482~29273~    2006-11-14 06:19:46.000000000 -0800
+++ perl/pp_hot.c       2006-11-21 06:45:19.000000000 -0800
@@ -138,7 +138,7 @@
            assert(SvROK(cv));
        }
 
-       /* Can do the optimisation if right (LVAUE) is not a typeglob,
+       /* Can do the optimisation if right (LVALUE) is not a typeglob,
           left (RVALUE) is a reference to something, and we're in void
           context. */
        if (!got_coderef && gv_type != SVt_PVGV && GIMME_V == G_VOID) {
@@ -180,6 +180,10 @@
            LEAVE;
        }
 
+       if (strEQ(GvNAME(right),"isa")) {
+           GvCVGEN(right) = 0;
+           ++PL_sub_generation;
+       }
     }
     SvSetMagicSV(right, left);
     SETs(right);

==== //depot/perl/t/op/universal.t#30 (xtext) ====
Index: perl/t/op/universal.t
--- perl/t/op/universal.t#29~28392~     2006-06-13 02:23:23.000000000 -0700
+++ perl/t/op/universal.t       2006-11-21 06:45:19.000000000 -0800
@@ -10,7 +10,7 @@
     require "./test.pl";
 }
 
-plan tests => 109;
+plan tests => 110;
 
 $a = {};
 bless $a, "Bob";
@@ -216,3 +216,10 @@
 ok( Bar->DOES( 'Foo' ), '... even when inherited' );
 ok( Baz->DOES( 'Baz' ), '... even without inheriting any other DOES()' );
 ok( ! Baz->DOES( 'Foo' ), '... returning true or false appropriately' );
+
+package Pig;
+package Bodine;
+Bodine->isa('Pig');
+*isa = \&UNIVERSAL::isa;
+eval { isa({}, 'HASH') };
+::is($@, '', "*isa correctly found")
End of Patch.

Reply via email to