diff options
author | David Mitchell <davem@iabyn.com> | 2012-12-25 18:24:50 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2012-12-25 18:24:50 +0000 |
commit | 39819bd9daad8177c22032658cbd5c354aa2b92f (patch) | |
tree | 66e8b337898a4dab878eb0e13a131bccc7e38fd7 /regexec.c | |
parent | 984e6dd18b2c93d4a6ae228bb9d2d98aadf7ca6e (diff) | |
download | perl-39819bd9daad8177c22032658cbd5c354aa2b92f.tar.gz |
eliminate RF_warned flag from PL_reg_flags
This global flag indicates whether the currently executing regex has
issued a recursion limit warning yet.
Replace it with a boolean var local to the regmatch_info struct.
This is a second step to eliminating PL_reg_flags.
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -94,7 +94,6 @@ static const char* const non_utf8_target_but_utf8_required #include "unicode_constants.h" #define RF_tainted 1 /* tainted information used? e.g. locale */ -#define RF_warned 2 /* warned about big count? */ #define HAS_NONLATIN1_FOLD_CLOSURE(i) _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C(i) @@ -2110,6 +2109,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend, PL_reg_maxiter = 0; reginfo.is_utf8_pat = cBOOL(RX_UTF8(rx)); + reginfo.warned = FALSE; /* Mark beginning of line for ^ and lookbehind. */ reginfo.bol = startpos; /* XXX not used ??? */ PL_bostr = strbeg; @@ -5552,9 +5552,9 @@ NULL do_whilem_B_max: if (cur_curlyx->u.curlyx.count >= REG_INFTY && ckWARN(WARN_REGEXP) - && !(PL_reg_flags & RF_warned)) + && !reginfo->warned) { - PL_reg_flags |= RF_warned; + reginfo->warned = TRUE; Perl_warner(aTHX_ packWARN(WARN_REGEXP), "Complex regular subexpression recursion limit (%d) " "exceeded", @@ -5577,9 +5577,9 @@ NULL /* Maximum greed exceeded */ if (cur_curlyx->u.curlyx.count >= REG_INFTY && ckWARN(WARN_REGEXP) - && !(PL_reg_flags & RF_warned)) + && !reginfo->warned) { - PL_reg_flags |= RF_warned; + reginfo->warned = TRUE; Perl_warner(aTHX_ packWARN(WARN_REGEXP), "Complex regular subexpression recursion " "limit (%d) exceeded", |