summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-09-01 16:27:48 +0000
committerNicholas Clark <nick@ccl4.org>2006-09-01 16:27:48 +0000
commit1c75a43bf7257081c0bfa53f793afc33ee95ff02 (patch)
tree37fb00e35dc65350aa84c0ec579e2f9aff43ef62 /cop.h
parent006bba40b64d69fcc85f3e7a0fe4b845e93164c0 (diff)
downloadperl-1c75a43bf7257081c0bfa53f793afc33ee95ff02.tar.gz
Access to cx->blk_sub.lval via macros (as it's about to move).
p4raw-id: //depot/perl@28773
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/cop.h b/cop.h
index c248eed639..df07aa6321 100644
--- a/cop.h
+++ b/cop.h
@@ -274,13 +274,19 @@ struct block_sub {
OP * retop; /* op to execute on exit from sub */
};
+#define CX_SUB_HASARGS_SET(cx, v) ((cx)->blk_sub.hasargs = (v))
+#define CX_SUB_HASARGS_GET(cx) ((cx)->blk_sub.hasargs + 0)
+
+#define CX_SUB_LVAL_SET(cx, v) ((cx)->blk_sub.lval = (v) & \
+ (OPpLVAL_INTRO|OPpENTERSUB_INARGS))
+#define CX_SUB_LVAL(cx) ((cx)->blk_sub.lval + 0)
+#define CX_SUB_LVAL_INARGS(cx) ((cx)->blk_sub.lval & \
+ OPpENTERSUB_INARGS)
+
/* base for the next two macros. Don't use directly.
* Note that the refcnt of the cv is incremented twice; The CX one is
* decremented by LEAVESUB, the other by LEAVE. */
-#define CX_SUB_HASARGS_SET(cx, v) ((cx)->blk_sub.hasargs = (v))
-#define CX_SUB_HASARGS_GET(cx) ((cx)->blk_sub.hasargs + 0)
-
#define PUSHSUB_BASE(cx) \
cx->blk_sub.cv = cv; \
cx->blk_sub.olddepth = CvDEPTH(cv); \
@@ -295,13 +301,12 @@ struct block_sub {
#define PUSHSUB(cx) \
PUSHSUB_BASE(cx) \
- cx->blk_sub.lval = PL_op->op_private & \
- (OPpLVAL_INTRO|OPpENTERSUB_INARGS);
+ CX_SUB_LVAL_SET(cx, PL_op->op_private)
/* variant for use by OP_DBSTATE, where op_private holds hint bits */
#define PUSHSUB_DB(cx) \
PUSHSUB_BASE(cx) \
- cx->blk_sub.lval = 0;
+ CX_SUB_LVAL_SET(cx, 0)
#define PUSHFORMAT(cx) \