summaryrefslogtreecommitdiff
path: root/pp.h
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgs@consttype.org>2010-04-21 15:47:36 +0200
committerRafael Garcia-Suarez <rgs@consttype.org>2010-04-21 15:47:36 +0200
commit94fa954eaae532928977ae7f7290536783269b6e (patch)
treeeff626a6f644511b62f4c92ae1df5cee84e810e0 /pp.h
parent73d3d06d86e1eead8f63e5190682ceacbaef8ac1 (diff)
downloadperl-94fa954eaae532928977ae7f7290536783269b6e.tar.gz
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).
Diffstat (limited to 'pp.h')
-rw-r--r--pp.h3
1 files changed, 2 insertions, 1 deletions
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<TARG>. See also C<XPUSHu>, C<mPUSHu> and C<PUSHu>.
#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), \