summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/re/re.xs3
-rw-r--r--regcomp.c3
-rw-r--r--regexp.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/ext/re/re.xs b/ext/re/re.xs
index 94cb2f5be2..72e4a703c8 100644
--- a/ext/re/re.xs
+++ b/ext/re/re.xs
@@ -107,7 +107,8 @@ PPCODE:
const char *fptr = INT_PAT_MODS;
char ch;
- U16 match_flags = (U16)((re->extflags & PMf_COMPILETIME) >> 12);
+ U16 match_flags = (U16)((re->extflags & PMf_COMPILETIME)
+ >> RXf_PMf_STD_PMMOD_SHIFT);
while((ch = *fptr++)) {
if(match_flags & 1) {
diff --git a/regcomp.c b/regcomp.c
index 070b18327a..10e63f5129 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4286,7 +4286,8 @@ redo_first_pass:
bool has_p = ((r->extflags & RXf_PMf_KEEPCOPY) == RXf_PMf_KEEPCOPY);
bool has_minus = ((r->extflags & RXf_PMf_STD_PMMOD) != RXf_PMf_STD_PMMOD);
bool has_runon = ((RExC_seen & REG_SEEN_RUN_ON_COMMENT)==REG_SEEN_RUN_ON_COMMENT);
- U16 reganch = (U16)((r->extflags & RXf_PMf_STD_PMMOD) >> 12);
+ U16 reganch = (U16)((r->extflags & RXf_PMf_STD_PMMOD)
+ >> RXf_PMf_STD_PMMOD_SHIFT);
const char *fptr = STD_PAT_MODS; /*"msix"*/
char *p;
RX_WRAPLEN(r) = plen + has_minus + has_p + has_runon
diff --git a/regexp.h b/regexp.h
index 60606a5158..29588751dd 100644
--- a/regexp.h
+++ b/regexp.h
@@ -255,6 +255,7 @@ and check for NULL.
#define RXf_PMf_EXTENDED 0x00008000 /* /x */
#define RXf_PMf_KEEPCOPY 0x00010000 /* /p */
/* these flags are transfered from the PMOP->op_pmflags member during compilation */
+#define RXf_PMf_STD_PMMOD_SHIFT 12
#define RXf_PMf_STD_PMMOD (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_FOLD|RXf_PMf_EXTENDED)
#define RXf_PMf_COMPILETIME (RXf_PMf_MULTILINE|RXf_PMf_SINGLELINE|RXf_PMf_LOCALE|RXf_PMf_FOLD|RXf_PMf_EXTENDED|RXf_PMf_KEEPCOPY)