diff options
-rw-r--r-- | op_reg_common.h | 7 | ||||
-rw-r--r-- | pod/perldebguts.pod | 3 | ||||
-rw-r--r-- | regcomp.c | 15 | ||||
-rw-r--r-- | regcomp.sym | 2 | ||||
-rw-r--r-- | regexec.c | 2 | ||||
-rw-r--r-- | regnodes.h | 2 |
6 files changed, 20 insertions, 11 deletions
diff --git a/op_reg_common.h b/op_reg_common.h index 9dcdaaec63..108589ee60 100644 --- a/op_reg_common.h +++ b/op_reg_common.h @@ -98,8 +98,11 @@ get_regex_charset(const U32 flags) #define RXf_PMf_COMPILETIME (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_FOLD|RXf_PMf_EXTENDED|RXf_PMf_KEEPCOPY|RXf_PMf_CHARSET) #define RXf_PMf_FLAGCOPYMASK (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_FOLD|RXf_PMf_EXTENDED|RXf_PMf_KEEPCOPY|RXf_PMf_CHARSET|RXf_PMf_SPLIT) -#if RXf_PMf_COMPILETIME > 255 -# error RXf_PMf_COMPILETIME wont fit in U8 flags field of eval node + /* Exclude win32 because it can't cope with I32_MAX definition */ +#ifndef WIN32 +# if RXf_PMf_COMPILETIME > I32_MAX +# error RXf_PMf_COMPILETIME wont fit in arg2 field of eval node +# endif #endif /* These copies need to be numerical or defsubs_h.PL won't know about them. */ diff --git a/pod/perldebguts.pod b/pod/perldebguts.pod index 814949d6b7..59d27b094f 100644 --- a/pod/perldebguts.pod +++ b/pod/perldebguts.pod @@ -716,7 +716,8 @@ will be lost. # The heavy worker - EVAL evl 1 Execute some Perl code. + EVAL evl/flags Execute some Perl code. + 2L # Modifiers @@ -10005,17 +10005,22 @@ S_reg(pTHX_ RExC_state_t *pRExC_state, I32 paren, I32 *flagp,U32 depth) if (is_logical) { regnode *eval; ret = reg_node(pRExC_state, LOGICAL); - eval = reganode(pRExC_state, EVAL, n); + + eval = reg2Lanode(pRExC_state, EVAL, + n, + + /* for later propagation into (??{}) + * return value */ + RExC_flags & RXf_PMf_COMPILETIME + ); if (!SIZE_ONLY) { ret->flags = 2; - /* for later propagation into (??{}) return value */ - eval->flags = (U8) (RExC_flags & RXf_PMf_COMPILETIME); } REGTAIL(pRExC_state, ret, eval); /* deal with the length of this later - MJD */ return ret; } - ret = reganode(pRExC_state, EVAL, n); + ret = reg2Lanode(pRExC_state, EVAL, n, 0); Set_Node_Length(ret, RExC_parse - parse_start + 1); Set_Node_Offset(ret, parse_start); return ret; @@ -15501,7 +15506,7 @@ S_reg2Lanode(pTHX_ RExC_state_t *pRExC_state, const U8 op, const U32 arg1, const { /* emit a node with U32 and I32 arguments */ - regnode * const ret = regnode_guts(pRExC_state, op, regarglen[op], "rega2Lnode"); + regnode * const ret = regnode_guts(pRExC_state, op, regarglen[op], "reg2Lanode"); PERL_ARGS_ASSERT_REG2LANODE; diff --git a/regcomp.sym b/regcomp.sym index 93019922da..2178503dcc 100644 --- a/regcomp.sym +++ b/regcomp.sym @@ -165,7 +165,7 @@ GROUPP GROUPP, num 1 ; Whether the group matched. #*The heavy worker -EVAL EVAL, evl 1 ; Execute some Perl code. +EVAL EVAL, evl/flags 2L ; Execute some Perl code. #*Modifiers @@ -5448,7 +5448,7 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog) re_sv = rex->engine->op_comp(aTHX_ &ret, 1, NULL, rex->engine, NULL, NULL, /* copy /msix etc to inner pattern */ - scan->flags, + ARG2L(scan), pm_flags); if (!(SvFLAGS(ret) diff --git a/regnodes.h b/regnodes.h index 3feb312f93..73b81a1c2f 100644 --- a/regnodes.h +++ b/regnodes.h @@ -357,7 +357,7 @@ static const U8 regarglen[] = { EXTRA_SIZE(struct regnode_1), /* SUSPEND */ EXTRA_SIZE(struct regnode_1), /* IFTHEN */ EXTRA_SIZE(struct regnode_1), /* GROUPP */ - EXTRA_SIZE(struct regnode_1), /* EVAL */ + EXTRA_SIZE(struct regnode_2L), /* EVAL */ 0, /* MINMOD */ 0, /* LOGICAL */ EXTRA_SIZE(struct regnode_1), /* RENUM */ |