From: Rafael Garcia-Suarez Date: Wed, 21 Apr 2010 13:47:36 +0000 (+0200) Subject: Fix [perl #74542] 5.12.0 crash on diverse platforms X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=94fa954eaae532928977ae7f7290536783269b6e;p=p5sagit%2Fp5-mst-13.2.git 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). --- diff --git a/pp.h b/pp.h index 9d078af..c36502a 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), \