This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Skip trailing constants when searching pads
[perl5.git] / mg.c
diff --git a/mg.c b/mg.c
index 4ef6c25..a6f2c53 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -397,6 +397,8 @@ S_mg_findext_flags(pTHX_ const SV *sv, int type, const MGVTBL *vtbl, U32 flags)
     if (sv) {
        MAGIC *mg;
 
+       assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv)));
+
        for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
            if (mg->mg_type == type && (!flags || mg->mg_virtual == vtbl)) {
                return mg;