Change 33684 by [EMAIL PROTECTED] on 2008/04/15 08:36:48

        Fix for [perl #52074] Segfault on ISA push after symbol table delete
        
        This restores the 5.8.8 behaviour. The deleted stash is not vivified
        again, hence the hierarchy remains broken. But there's no segfault.

Affected files ...

... //depot/perl/mg.c#525 edit
... //depot/perl/t/mro/pkg_gen.t#2 edit

Differences ...

==== //depot/perl/mg.c#525 (text) ====
Index: perl/mg.c
--- perl/mg.c#524~33627~        2008-04-01 12:59:54.000000000 -0700
+++ perl/mg.c   2008-04-15 01:36:48.000000000 -0700
@@ -1607,7 +1607,8 @@
             : (GV*)SvMAGIC(mg->mg_obj)->mg_obj
     );
 
-    mro_isa_changed_in(stash);
+    if (stash)
+       mro_isa_changed_in(stash);
 
     return 0;
 }
@@ -1632,7 +1633,8 @@
             : (GV*)SvMAGIC(mg->mg_obj)->mg_obj
     );
 
-    mro_isa_changed_in(stash);
+    if (stash)
+       mro_isa_changed_in(stash);
 
     return 0;
 }

==== //depot/perl/t/mro/pkg_gen.t#2 (text) ====
Index: perl/t/mro/pkg_gen.t
--- perl/t/mro/pkg_gen.t#1~31239~       2007-05-18 18:00:15.000000000 -0700
+++ perl/t/mro/pkg_gen.t        2008-04-15 01:36:48.000000000 -0700
@@ -4,7 +4,7 @@
 use warnings;
 
 chdir 't' if -d 't';
-require q(./test.pl); plan(tests => 6);
+require q(./test.pl); plan(tests => 7);
 
 {
     package Foo;
@@ -34,3 +34,7 @@
 
 delete $::{"Foo::"};
 is(mro::get_pkg_gen('Foo'), 0, 'pkg_gen 0 for delete $::{Pkg::}');
+
+delete $::{"Quux::"};
+push @Quux::ISA, "Woot"; # should not segfault
+ok(1, "No segfault on modification of ISA in a deleted stash");
End of Patch.

Reply via email to