This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
avoid local *f = \&foo resetting the method cache
[perl5.git] / scope.c
diff --git a/scope.c b/scope.c
index 66589ab..50036d0 100644 (file)
--- a/scope.c
+++ b/scope.c
@@ -846,7 +846,7 @@ Perl_leave_scope(pTHX_ I32 base)
            {
                if ((char *)svp < (char *)GvGP(ARG2_GV)
                 || (char *)svp > (char *)GvGP(ARG2_GV) + sizeof(struct gp)
-                || GvREFCNT(ARG2_GV) > 1)
+                || GvREFCNT(ARG2_GV) > 2) /* "> 2" to ignore savestack's ref */
                    PL_sub_generation++;
                else mro_method_changed_in(hv);
            }