This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid reifying GV when lex stub is used as method
[perl5.git] / gv.c
diff --git a/gv.c b/gv.c
index 1b490f8..13f87d6 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -1101,7 +1101,7 @@ Perl_gv_fetchmethod_pvn_flags(pTHX_ HV *stash, const char *name, const STRLEN le
            GV* stubgv;
            GV* autogv;
 
-           if (CvANON(cv) || !CvGV(cv))
+           if (CvANON(cv) || CvLEXICAL(cv))
                stubgv = gv;
            else {
                stubgv = CvGV(cv);