In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/05bda26ce45ab1f7024d0e8a656a251a181f0275?hp=0af40c757f083cc12988effb46da5313cd042f00>
- Log ----------------------------------------------------------------- commit 05bda26ce45ab1f7024d0e8a656a251a181f0275 Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Sep 5 10:14:29 2016 -0700 Fix up B::Concise tests following op flag change M ext/B/t/optree_specials.t commit 1de22db27a9aaa5fec9e9b93ec06a1d6c6f05c31 Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Sep 5 09:31:31 2016 -0700 [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. M op.c M pp_hot.c commit 9493dad184630fd01d49f6b613821550566a587c Author: Rick Delaney <r...@bort.ca> Date: Mon Sep 5 09:25:59 2016 -0700 Test for perl #47047 M t/lib/warnings/gv commit 63433e93928eda511e2444d6caea6da9a03a256c Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 4 23:27:42 2016 -0700 No need to skip t/op/dump.t on darwin M t/op/dump.t commit f441d7d224a86a59913b23e5e17431baf03db56e Author: Father Chrysostomos <spr...@cpan.org> Date: Sun Sep 4 23:14:21 2016 -0700 Stop setting OPf_REF on OP_ENTERSUB It isnât doing anything really here, and I need it for another purpose. M op.c ----------------------------------------------------------------------- Summary of changes: ext/B/t/optree_specials.t | 36 ++++++++++++++++++------------------ op.c | 6 ++++-- pp_hot.c | 5 ++++- t/lib/warnings/gv | 2 ++ t/op/dump.t | 2 +- 5 files changed, 29 insertions(+), 22 deletions(-) diff --git a/ext/B/t/optree_specials.t b/ext/B/t/optree_specials.t index d7200db..83ea44e 100644 --- a/ext/B/t/optree_specials.t +++ b/ext/B/t/optree_specials.t @@ -48,7 +48,7 @@ checkOptree ( name => 'BEGIN', # - <;> ex-nextstate(B::Concise -837 Concise.pm:366) v:*,&,{,x*,x&,x$,$ ->4 # - <@> lineseq K ->- # 4 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,x*,x&,x$,$ ->5 -# 9 <1> entersub[t1] KS*/TARG,STRICT ->a +# 9 <1> entersub[t1] KRS*/TARG,STRICT ->a # 5 <0> pushmark s ->6 # 6 <$> const[PV "strict"] sM ->7 # 7 <$> const[PV "refs"] sM ->8 @@ -62,7 +62,7 @@ checkOptree ( name => 'BEGIN', # - <;> ex-nextstate(B::Concise -812 Concise.pm:386) v:*,&,x*,x&,x$,$ ->e # - <@> lineseq K ->- # e <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,x*,x&,x$,$ ->f -# j <1> entersub[t1] KS*/TARG,STRICT ->k +# j <1> entersub[t1] KRS*/TARG,STRICT ->k # f <0> pushmark s ->g # g <$> const[PV "strict"] sM ->h # h <$> const[PV "refs"] sM ->i @@ -76,7 +76,7 @@ checkOptree ( name => 'BEGIN', # - <;> ex-nextstate(B::Concise -798 Concise.pm:406) v:*,&,{,x*,x&,x$,$ ->o # - <@> lineseq K ->- # o <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,x*,x&,x$,$ ->p -# t <1> entersub[t1] KS*/TARG,STRICT ->u +# t <1> entersub[t1] KRS*/TARG,STRICT ->u # p <0> pushmark s ->q # q <$> const[PV "warnings"] sM ->r # r <$> const[PV "qw"] sM ->s @@ -98,7 +98,7 @@ EOT_EOT # - <;> ex-nextstate(B::Concise -837 Concise.pm:366) v:*,&,{,x*,x&,x$,$ ->4 # - <@> lineseq K ->- # 4 <;> nextstate(B::Concise -275 Concise.pm:356) :*,&,{,x*,x&,x$,$ ->5 -# 9 <1> entersub[t1] KS*/TARG,STRICT ->a +# 9 <1> entersub[t1] KRS*/TARG,STRICT ->a # 5 <0> pushmark s ->6 # 6 <$> const(PV "strict") sM ->7 # 7 <$> const(PV "refs") sM ->8 @@ -112,7 +112,7 @@ EOT_EOT # - <;> ex-nextstate(B::Concise -812 Concise.pm:386) v:*,&,x*,x&,x$,$ ->e # - <@> lineseq K ->- # e <;> nextstate(B::Concise -265 Concise.pm:367) :*,&,x*,x&,x$,$ ->f -# j <1> entersub[t1] KS*/TARG,STRICT ->k +# j <1> entersub[t1] KRS*/TARG,STRICT ->k # f <0> pushmark s ->g # g <$> const(PV "strict") sM ->h # h <$> const(PV "refs") sM ->i @@ -126,7 +126,7 @@ EOT_EOT # - <;> ex-nextstate(B::Concise -798 Concise.pm:406) v:*,&,{,x*,x&,x$,$ ->o # - <@> lineseq K ->- # o <;> nextstate(B::Concise -254 Concise.pm:386) :*,&,{,x*,x&,x$,$ ->p -# t <1> entersub[t1] KS*/TARG,STRICT ->u +# t <1> entersub[t1] KRS*/TARG,STRICT ->u # p <0> pushmark s ->q # q <$> const(PV "warnings") sM ->r # r <$> const(PV "qw") sM ->s @@ -246,7 +246,7 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # 6 <$> const[PV "strict"] sM # 7 <$> const[PV "refs"] sM # 8 <.> method_named[PV "unimport"] -# 9 <1> entersub[t1] KS*/TARG,STRICT +# 9 <1> entersub[t1] KRS*/TARG,STRICT # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: # b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ @@ -257,7 +257,7 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # g <$> const[PV "strict"] sM # h <$> const[PV "refs"] sM # i <.> method_named[PV "unimport"] -# j <1> entersub[t1] KS*/TARG,STRICT +# j <1> entersub[t1] KRS*/TARG,STRICT # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: # l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ @@ -268,7 +268,7 @@ checkOptree ( name => 'all of BEGIN END INIT CHECK UNITCHECK -exec', # q <$> const[PV "warnings"] sM # r <$> const[PV "qw"] sM # s <.> method_named[PV "unimport"] -# t <1> entersub[t1] KS*/TARG,STRICT +# t <1> entersub[t1] KRS*/TARG,STRICT # u <1> leavesub[1 ref] K/REFC,1 # BEGIN 4: # v <;> nextstate(main 2 -e:1) v:>,<,%,{ @@ -305,7 +305,7 @@ EOT_EOT # 6 <$> const(PV "strict") sM # 7 <$> const(PV "refs") sM # 8 <.> method_named(PV "unimport") -# 9 <1> entersub[t1] KS*/TARG,STRICT +# 9 <1> entersub[t1] KRS*/TARG,STRICT # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: # b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ @@ -316,7 +316,7 @@ EOT_EOT # g <$> const(PV "strict") sM # h <$> const(PV "refs") sM # i <.> method_named(PV "unimport") -# j <1> entersub[t1] KS*/TARG,STRICT +# j <1> entersub[t1] KRS*/TARG,STRICT # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: # l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ @@ -327,7 +327,7 @@ EOT_EOT # q <$> const(PV "warnings") sM # r <$> const(PV "qw") sM # s <.> method_named(PV "unimport") -# t <1> entersub[t1] KS*/TARG,STRICT +# t <1> entersub[t1] KRS*/TARG,STRICT # u <1> leavesub[1 ref] K/REFC,1 # BEGIN 4: # v <;> nextstate(main 2 -e:1) v:>,<,%,{ @@ -374,7 +374,7 @@ checkOptree ( name => 'regression test for patch 25352', # 6 <$> const[PV "strict"] sM # 7 <$> const[PV "refs"] sM # 8 <.> method_named[PV "unimport"] -# 9 <1> entersub[t1] KS*/TARG,STRICT +# 9 <1> entersub[t1] KRS*/TARG,STRICT # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: # b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ @@ -385,7 +385,7 @@ checkOptree ( name => 'regression test for patch 25352', # g <$> const[PV "strict"] sM # h <$> const[PV "refs"] sM # i <.> method_named[PV "unimport"] -# j <1> entersub[t1] KS*/TARG,STRICT +# j <1> entersub[t1] KRS*/TARG,STRICT # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: # l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ @@ -396,7 +396,7 @@ checkOptree ( name => 'regression test for patch 25352', # q <$> const[PV "warnings"] sM # r <$> const[PV "qw"] sM # s <.> method_named[PV "unimport"] -# t <1> entersub[t1] KS*/TARG,STRICT +# t <1> entersub[t1] KRS*/TARG,STRICT # u <1> leavesub[1 ref] K/REFC,1 EOT_EOT # BEGIN 1: @@ -408,7 +408,7 @@ EOT_EOT # 6 <$> const(PV "strict") sM # 7 <$> const(PV "refs") sM # 8 <.> method_named(PV "unimport") -# 9 <1> entersub[t1] KS*/TARG,STRICT +# 9 <1> entersub[t1] KRS*/TARG,STRICT # a <1> leavesub[1 ref] K/REFC,1 # BEGIN 2: # b <;> nextstate(B::Concise -265 Concise.pm:367) v:*,&,x*,x&,x$,$ @@ -419,7 +419,7 @@ EOT_EOT # g <$> const(PV "strict") sM # h <$> const(PV "refs") sM # i <.> method_named(PV "unimport") -# j <1> entersub[t1] KS*/TARG,STRICT +# j <1> entersub[t1] KRS*/TARG,STRICT # k <1> leavesub[1 ref] K/REFC,1 # BEGIN 3: # l <;> nextstate(B::Concise -254 Concise.pm:386) v:*,&,{,x*,x&,x$,$ @@ -430,6 +430,6 @@ EOT_EOT # q <$> const(PV "warnings") sM # r <$> const(PV "qw") sM # s <.> method_named(PV "unimport") -# t <1> entersub[t1] KS*/TARG,STRICT +# t <1> entersub[t1] KRS*/TARG,STRICT # u <1> leavesub[1 ref] K/REFC,1 EONT_EONT diff --git a/op.c b/op.c index 30b5024..10a6db1 100644 --- a/op.c +++ b/op.c @@ -3272,7 +3272,8 @@ Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags) o->op_flags |= OPf_MOD; if (type == OP_AASSIGN || type == OP_SASSIGN) - o->op_flags |= OPf_SPECIAL|OPf_REF; + o->op_flags |= OPf_SPECIAL + |(o->op_type == OP_ENTERSUB ? 0 : OPf_REF); else if (!type) { /* local() */ switch (localize) { case 1: @@ -3288,7 +3289,7 @@ Perl_op_lvalue_flags(pTHX_ OP *o, I32 type, U32 flags) } } else if (type != OP_GREPSTART && type != OP_ENTERSUB - && type != OP_LEAVESUBLV) + && type != OP_LEAVESUBLV && o->op_type != OP_ENTERSUB) o->op_flags |= OPf_REF; return o; } @@ -11943,6 +11944,7 @@ Perl_ck_subr(pTHX_ OP *o) case OP_METHOD_SUPER: case OP_METHOD_REDIR: case OP_METHOD_REDIR_SUPER: + o->op_flags |= OPf_REF; if (aop->op_type == OP_CONST) { aop->op_private &= ~OPpCONST_STRICT; const_class = &cSVOPx(aop)->op_sv; diff --git a/pp_hot.c b/pp_hot.c index a794fd5..9da9ab0 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -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) { diff --git a/t/lib/warnings/gv b/t/lib/warnings/gv index 85e4c0a..8a93f8b 100644 --- a/t/lib/warnings/gv +++ b/t/lib/warnings/gv @@ -43,6 +43,8 @@ sub Other::AUTOLOAD { 1 } sub Other::fred {} @ISA = qw(Other) ; use warnings 'deprecated' ; fred() ; +my $x = \&barney; +(bless[])->barney; EXPECT Use of inherited AUTOLOAD for non-method main::fred() is deprecated at - line 5. ######## diff --git a/t/op/dump.t b/t/op/dump.t index e261db1..6b53a06 100644 --- a/t/op/dump.t +++ b/t/op/dump.t @@ -23,7 +23,7 @@ skip_all("only tested on devel builds") # fork() and waitpid(). skip_all("no point in dumping on $^O") - unless $^O =~ /^(linux|.*bsd|solaris)$/; + unless $^O =~ /^(linux|.*bsd|solaris|darwin)$/; skip_all("avoid coredump under ASan") if $Config{ccflags} =~ /-fsanitize=/; -- Perl5 Master Repository