diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-09-05 09:31:31 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-09-05 09:32:39 -0700 |
commit | 1de22db27a9aaa5fec9e9b93ec06a1d6c6f05c31 (patch) | |
tree | 8751b5eda7613a527e53a1749688c114eb20981c /pp_hot.c | |
parent | 9493dad184630fd01d49f6b613821550566a587c (diff) | |
download | perl-1de22db27a9aaa5fec9e9b93ec06a1d6c6f05c31.tar.gz |
[perl #47047] Fix erroneous AUTOLOAD warning
If there was a stub present in the package into which the invocant had
been blessed, then AUTOLOADing via a *method* call would warn with ‘Use
of inherited AUTOLOAD for non-method’ even if it is a method.
A recent commit stopped OPf_REF from being set on OP_ENTERSUB, so this
commit uses that flag to indicate a method call, to allow a fast run-
time check to see whether to pass the method flag to gv_autoload.
Diffstat (limited to 'pp_hot.c')
-rw-r--r-- | pp_hot.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -3817,7 +3817,10 @@ PP(pp_entersub) else { try_autoload: autogv = gv_autoload_pvn(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv), - GvNAMEUTF8(gv) ? SVf_UTF8 : 0); + (GvNAMEUTF8(gv) ? SVf_UTF8 : 0) + |(PL_op->op_flags & OPf_REF + ? GV_AUTOLOAD_ISMETHOD + : 0)); cv = autogv ? GvCV(autogv) : NULL; } if (!cv) { |