This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
handy.h: Add intermediate internal macro
[perl5.git] / gv.c
diff --git a/gv.c b/gv.c
index 8251c29..c165285 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -83,6 +83,9 @@ Perl_gv_add_by_type(pTHX_ GV *gv, svtype type)
 
     if (!*where)
        *where = newSV_type(type);
+    if (type == SVt_PVAV && GvNAMELEN(gv) == 3
+     && strnEQ(GvNAME(gv), "ISA", 3))
+       sv_magic(*where, (SV *)gv, PERL_MAGIC_isa, NULL, 0);
     return gv;
 }
 
@@ -1223,6 +1226,8 @@ Perl_gv_autoload_pvn(pTHX_ HV *stash, const char *name, STRLEN len, U32 flags)
     }
     LEAVE;
     varsv = GvSVn(vargv);
+    SvTAINTED_off(varsv); /* previous $AUTOLOAD taint is obsolete */
+    /* XXX: this process is not careful to avoid extra magic gets and sets; tied $AUTOLOAD will get noise */
     sv_setsv(varsv, packname);
     sv_catpvs(varsv, "::");
     /* Ensure SvSETMAGIC() is called if necessary. In particular, to clear
@@ -2274,13 +2279,16 @@ Perl_Gv_AMupdate(pTHX_ HV *stash, bool destructing)
        NOOP;   /* Equivalent to !SvTRUE and !SvOK  */
     }
 #endif
-    else if (SvTRUE(sv)) {
+    else if (SvTRUE(sv))
+        /* don't need to set overloading here because fallback => 1
+         * is the default setting for classes without overloading */
        amt.fallback=AMGfallYES;
+    else if (SvOK(sv)) {
+       amt.fallback=AMGfallNEVER;
         filled = 1;
         have_ovl = 1;
     }
-    else if (SvOK(sv)) {
-       amt.fallback=AMGfallNEVER;
+    else {
         filled = 1;
         have_ovl = 1;
     }