summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2019-05-21 17:34:49 +0100
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2019-05-27 17:30:34 +0100
commit1d31efef7dd4388fd606972e67bda3318e8838fe (patch)
treed9e6fd80636771a7c37b562003cf5bf0c16cddf0 /op.h
parentd4e32ec55bb4cf73441c3c8749fd6545c9af4259 (diff)
downloadperl-1d31efef7dd4388fd606972e67bda3318e8838fe.tar.gz
Don't use PL_check[op_type] to check for filetets ops to stack
This breaks hooking the filetest ops' check function by modules like bareword::filehandles. Instead use the OP_IS_FILETEST() macro to decide check for filetest ops. Also add an OP_IS_STAT() macro for when we want to check for (l)stat as well as the filetest ops. c.f. https://rt.cpan.org/Ticket/Display.html?id=127073
Diffstat (limited to 'op.h')
-rw-r--r--op.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/op.h b/op.h
index c9f05b2271..ad6cf7fe49 100644
--- a/op.h
+++ b/op.h
@@ -1021,6 +1021,8 @@ C<sib> is non-null. For a higher-level interface, see C<L</op_sibling_splice>>.
#define OP_TYPE_ISNT_AND_WASNT(o, type) \
( (o) && OP_TYPE_ISNT_AND_WASNT_NN(o, type) )
+/* should match anything that uses ck_ftst in regen/opcodes */
+#define OP_IS_STAT(op) (OP_IS_FILETEST(op) || (op) == OP_LSTAT || (op) == OP_STAT)
# define OpHAS_SIBLING(o) (cBOOL((o)->op_moresib))
# define OpSIBLING(o) (0 + (o)->op_moresib ? (o)->op_sibparent : NULL)