diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-09-10 19:47:59 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-09-10 21:46:51 -0700 |
commit | 49498cafba9ef826af2f85193bb77c26f9efbe77 (patch) | |
tree | b273ce2b856fbb333d01a97c8898b15a17e7649f /pp_sys.c | |
parent | 094a3eec8ad4cfb12d72a98f11e9186594579b57 (diff) | |
download | perl-49498cafba9ef826af2f85193bb77c26f9efbe77.tar.gz |
Stop filetest ops from calling FETCH on parent op’s arg
This is a regression in 5.14.0.
Commit 6f1401dc made ops call get-magic before overloading, but it
ended up making filetest ops call get-magic on the topmost item of the
stack even if the filetest op was not going to use the stack (which
happens for ‘-r bareword’ and plain ‘-r’).
This would affect cases like:
push @foo, $tied, -r;
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2897,6 +2897,7 @@ PP(pp_stat) #define tryAMAGICftest_MG(chr) STMT_START { \ if ( (SvFLAGS(TOPs) & (SVf_ROK|SVs_GMG)) \ + && PL_op->op_flags & OPf_KIDS \ && S_try_amagic_ftest(aTHX_ chr)) \ return NORMAL; \ } STMT_END @@ -2910,8 +2911,7 @@ S_try_amagic_ftest(pTHX_ char chr) { assert(chr != '?'); SvGETMAGIC(arg); - if ((PL_op->op_flags & OPf_KIDS) - && SvAMAGIC(TOPs)) + if (SvAMAGIC(TOPs)) { const char tmpchr = chr; SV * const tmpsv = amagic_call(arg, |