This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #127351] add isaelem magic on *Foo::ISA = arrayref
authorTony Cook <tony@develop-help.com>
Tue, 26 Jan 2016 04:53:34 +0000 (15:53 +1100)
committerTony Cook <tony@develop-help.com>
Tue, 2 Feb 2016 05:16:59 +0000 (16:16 +1100)
sv.c
t/mro/basic.t

diff --git a/sv.c b/sv.c
index e3e5af4..ad2208e 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -4184,9 +4184,18 @@ Perl_gv_setref(pTHX_ SV *const dstr, SV *const sstr)
            }
            else
            {
+                SSize_t i;
                sv_magic(
                 sref, omg ? omg->mg_obj : dstr, PERL_MAGIC_isa, NULL, 0
                );
+                for (i = 0; i <= AvFILL(sref); ++i) {
+                    SV **elem = av_fetch ((AV*)sref, i, 0);
+                    if (elem) {
+                        sv_magic(
+                          *elem, sref, PERL_MAGIC_isaelem, NULL, i
+                        );
+                    }
+                }
                mg = mg_find(sref, PERL_MAGIC_isa);
            }
            /* Since the *ISA assignment could have affected more than
index f68637a..8d54dc3 100644 (file)
@@ -436,7 +436,6 @@ PROG
 
 {
     # [perl #127351]
-    local $::TODO = "assignment to *Foo::ISA doesn't magicalize elements";
     # *Foo::ISA = \@some_array
     # didn't magicalize the elements of @some_array, causing two
     # problems: