RXf_MODIFIES_VARS
authorFather Chrysostomos <sprout@cpan.org>
Thu, 11 Oct 2012 15:37:44 +0000 (08:37 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 12 Oct 2012 06:07:35 +0000 (23:07 -0700)
regcomp.c sets this new flag whenever regops that could modify
$REGMARK or $REGERROR have been seen.  pp_subst will use this
to tell whether it should repeatedly stringify the replacement.

regcomp.c
regexp.h
regnodes.h

index 0cc711f..960d7c4 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -6360,7 +6360,10 @@ reStudy:
     if (RExC_seen & REG_SEEN_CANY)
        r->extflags |= RXf_CANY_SEEN;
     if (RExC_seen & REG_SEEN_VERBARG)
+    {
        r->intflags |= PREGf_VERBARG_SEEN;
+       r->extflags |= RXf_MODIFIES_VARS;
+    }
     if (RExC_seen & REG_SEEN_CUTGROUP)
        r->intflags |= PREGf_CUTGROUP_SEEN;
     if (pm_flags & PMf_USE_RE_EVAL)
index 8f43d19..f631db9 100644 (file)
--- a/regexp.h
+++ b/regexp.h
@@ -408,6 +408,8 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
 #define RXf_INTUIT_TAIL        (1<<(RXf_BASE_SHIFT+14))
 #define RXf_USE_INTUIT         (RXf_USE_INTUIT_NOML|RXf_USE_INTUIT_ML)
 
+#define RXf_MODIFIES_VARS      (1<<(RXf_BASE_SHIFT+15))
+
 /* Copy and tainted info */
 #define RXf_COPY_DONE          (1<<(RXf_BASE_SHIFT+16))
 
index d411b00..b53487d 100644 (file)
@@ -785,7 +785,7 @@ EXTCONST char * const PL_reg_name[] = {
 EXTCONST char * PL_reg_extflags_name[];
 #else
 EXTCONST char * const PL_reg_extflags_name[] = {
-       /* Bits in extflags defined: 11011110111111111111111011111111 */
+       /* Bits in extflags defined: 11011111111111111111111011111111 */
        "MULTILINE",        /* 0x00000001 */
        "SINGLELINE",       /* 0x00000002 */
        "FOLD",             /* 0x00000004 */
@@ -810,7 +810,7 @@ EXTCONST char * const PL_reg_extflags_name[] = {
        "USE_INTUIT_NOML",  /* 0x00200000 */
        "USE_INTUIT_ML",    /* 0x00400000 */
        "INTUIT_TAIL",      /* 0x00800000 */
-       "UNUSED_BIT_24",    /* 0x01000000 */
+       "MODIFIES_VARS",    /* 0x01000000 */
        "COPY_DONE",        /* 0x02000000 */
        "TAINTED_SEEN",     /* 0x04000000 */
        "TAINTED",          /* 0x08000000 */