From 94fa954eaae532928977ae7f7290536783269b6e Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 21 Apr 2010 15:47:36 +0200 Subject: Fix [perl #74542] 5.12.0 crash on diverse platforms Filetest ops don't always expect an op on the stack, so we should use TOPs only if we're sure that we're not stat'ing the _ filehandle. This is indicated by OPf_KIDS (as checked in ck_ftst). --- pp.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pp.h') diff --git a/pp.h b/pp.h index 9d078af5e5..c36502a03f 100644 --- a/pp.h +++ b/pp.h @@ -474,7 +474,8 @@ Does not use C. See also C, C and C. #define tryAMAGICftest(chr) \ STMT_START { \ assert(chr != '?'); \ - if (SvAMAGIC(TOPs)) { \ + if ((PL_op->op_flags & OPf_KIDS) \ + && SvAMAGIC(TOPs)) { \ const char tmpchr = (chr); \ SV * const tmpsv = amagic_call(TOPs, \ newSVpvn_flags(&tmpchr, 1, SVs_TEMP), \ -- cgit v1.2.1