diff options
-rw-r--r-- | hv.c | 7 | ||||
-rw-r--r-- | t/mro/basic.t | 10 |
2 files changed, 15 insertions, 2 deletions
@@ -1857,7 +1857,12 @@ Perl_hv_undef(pTHX_ HV *hv) xhv = (XPVHV*)SvANY(hv); if ((name = HvENAME_get(hv)) && !PL_dirty) - mro_isa_changed_in(hv); + { + /* Delete the @ISA element before calling mro_package_moved, so it + does not see it. */ + (void)hv_delete(hv, "ISA", 3, G_DISCARD); + mro_package_moved(NULL, hv, NULL, name, HvENAMELEN_get(hv)); + } hfreeentries(hv); if (name || (name = HvNAME(hv))) { diff --git a/t/mro/basic.t b/t/mro/basic.t index c6f25429b8..b42c802b49 100644 --- a/t/mro/basic.t +++ b/t/mro/basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -BEGIN { require q(./test.pl); } plan(tests => 51); +BEGIN { require q(./test.pl); } plan(tests => 52); require mro; @@ -320,3 +320,11 @@ is(eval { MRO_N->testfunc() }, 123); delete $Blength::{ISA}; ok !Blength->isa("Bladd"), 'delete $package::{ISA}'; } + +{ + # Undefining stashes + @Thrext::ISA = "Thwit"; + @Thwit::ISA = "Sile"; + undef %Thwit::; + ok !Thrext->isa('Sile'), 'undef %package:: updates subclasses'; +} |