Permalink
Browse files

regcomp.h: Create FILL_NODE macro and use it

This is a more fundamental operation than the pre-existing
FILL_ADVANCE_NODE, which is changed to use this for the portion that
fills the node but doesn't advance the pointer.
  • Loading branch information...
khwilliamson committed Sep 20, 2018
1 parent 4236896 commit 1c8e8008672529685c3a3d09120bc4132411c9b8
Showing with 11 additions and 3 deletions.
  1. +1 −1 regcomp.c
  2. +10 −2 regcomp.h
View
@@ -19332,7 +19332,7 @@ S_reginsert(pTHX_ RExC_state_t *pRExC_state, U8 op, regnode *operand, U32 depth)
#endif
src = NEXTOPER(place);
place->flags = 0;
FILL_ADVANCE_NODE(place, op);
FILL_NODE(place, op);
Zero(src, offset, regnode);
}
View
@@ -353,8 +353,16 @@ struct regnode_ssc {
#define NEXTOPER(p) ((p) + NODE_STEP_REGNODE)
#define PREVOPER(p) ((p) - NODE_STEP_REGNODE)
#define FILL_ADVANCE_NODE(ptr, op) STMT_START { \
(ptr)->type = op; (ptr)->next_off = 0; (ptr)++; } STMT_END
#define FILL_NODE(ptr, op) \
STMT_START { \
OP(ptr) = op; \
NEXT_OFF(ptr) = 0; \
} STMT_END
#define FILL_ADVANCE_NODE(ptr, op) \
STMT_START { \
FILL_NODE(ptr, op); \
(ptr)++; \
} STMT_END
#define FILL_ADVANCE_NODE_ARG(ptr, op, arg) STMT_START { \
ARG_SET(ptr, arg); FILL_ADVANCE_NODE(ptr, op); (ptr) += 1; } STMT_END
#define FILL_ADVANCE_NODE_2L_ARG(ptr, op, arg1, arg2) \

0 comments on commit 1c8e800

Please sign in to comment.