SV **location;
U8 import_flag = 0;
const U32 stype = SvTYPE(sref);
- bool mro_changes = FALSE;
PERL_ARGS_ASSERT_GLOB_ASSIGN_REF;
goto common;
case SVt_PVAV:
location = (SV **) &GvAV(dstr);
- if (strEQ(GvNAME((GV*)dstr), "ISA"))
- mro_changes = TRUE;
import_flag = GVf_IMPORTED_AV;
goto common;
case SVt_PVIO:
&& CopSTASH_ne(PL_curcop, GvSTASH(dstr))) {
GvFLAGS(dstr) |= import_flag;
}
+ if (stype == SVt_PVAV && strEQ(GvNAME((GV*)dstr), "ISA")) {
+ sv_magic(sref, dstr, PERL_MAGIC_isa, NULL, 0);
+ mro_isa_changed_in(GvSTASH(dstr));
+ }
break;
}
SvREFCNT_dec(dref);
if (SvTAINTED(sstr))
SvTAINT(dstr);
- if (mro_changes) mro_isa_changed_in(GvSTASH(dstr));
return;
}
use strict;
use warnings;
-require q(./test.pl); plan(tests => 44);
+require q(./test.pl); plan(tests => 48);
require mro;
}
{
+ # assigning @ISA via arrayref then modifying it RT 72866
+ {
+ package Q1;
+ sub foo { }
+
+ package Q2;
+ sub bar { }
+
+ package Q3;
+ }
+ push @Q3::ISA, "Q1";
+ can_ok("Q3", "foo");
+ *Q3::ISA = [];
+ push @Q3::ISA, "Q1";
+ can_ok("Q3", "foo");
+ *Q3::ISA = [];
+ push @Q3::ISA, "Q2";
+ can_ok("Q3", "bar");
+ ok(!Q3->can("foo"), "can't call foo method any longer");
+}
+
+{
# test mro::method_changed_in
my $count = mro::get_pkg_gen("MRO_A");
mro::method_changed_in("MRO_A");