diff options
author | Tony Cook <tony@develop-help.com> | 2015-03-05 15:17:41 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2016-01-11 11:43:45 +1100 |
commit | 5c8e69ec416d40935c4c2d1f240cdd70f076929e (patch) | |
tree | 65c6bec71d2a46a4919fd5b0e365166c944af105 /t | |
parent | 3c84cb847a0617ac7c7ef77edfb209aa1f32fd0e (diff) | |
download | perl-5c8e69ec416d40935c4c2d1f240cdd70f076929e.tar.gz |
[perl #123788] tests for making in in-use @ISA not an @ISA anymore
Diffstat (limited to 't')
-rw-r--r-- | t/mro/basic.t | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/t/mro/basic.t b/t/mro/basic.t index 3b7f9e886e..a037781487 100644 --- a/t/mro/basic.t +++ b/t/mro/basic.t @@ -9,7 +9,7 @@ BEGIN { use strict; use warnings; -plan(tests => 61); +plan(tests => 64); require mro; @@ -396,3 +396,41 @@ undef *UNIVERSAL::DESTROY; $#_119433::ISA++; pass "no crash when ISA contains nonexistent elements"; } + +{ # 123788 + local $::TODO = "crashes"; + fresh_perl_is(<<'PROG', "ok", {}, "don't crash when deleting ISA"); +$x = \@{q(Foo::ISA)}; +delete $Foo::{ISA}; +@$x = "Bar"; +print "ok\n"; +PROG + + # when there are multiple references to an ISA array, the mg_obj + # turns into an AV of globs, which is a different code path + # this test only crashes on -DDEBUGGING builds + fresh_perl_is(<<'PROG', "ok", {}, "a case with multiple refs to ISA"); +@Foo::ISA = qw(Abc Def); +$x = \@{q(Foo::ISA)}; +*Bar::ISA = $x; +delete $Bar::{ISA}; +delete $Foo::{ISA}; +++$y; +$x->[1] = "Ghi"; +@$x = "Bar"; +print "ok\n"; +PROG + + # reverse order of delete to exercise removing from the other end + # of the array + # again, may only crash on -DDEBUGGING builds + fresh_perl_is(<<'PROG', "ok", {}, "a case with multiple refs to ISA"); +$x = \@{q(Foo::ISA)}; +*Bar::ISA = $x; +delete $Foo::{ISA}; +delete $Bar::{ISA}; +++$y; +@$x = "Bar"; +print "ok\n"; +PROG +} |