From 49498cafba9ef826af2f85193bb77c26f9efbe77 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 10 Sep 2011 19:47:59 -0700 Subject: =?UTF-8?q?Stop=20filetest=20ops=20from=20calling=20FETCH=20on=20p?= =?UTF-8?q?arent=20op=E2=80=99s=20arg?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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; --- pp_sys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pp_sys.c') diff --git a/pp_sys.c b/pp_sys.c index d6ca53360c..271edee95a 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -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, -- cgit v1.2.1