summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-05-31 23:33:45 +0100
committerDavid Mitchell <davem@iabyn.com>2013-06-02 22:28:55 +0100
commit6c3fea77afb1df054862e697daf7fa3cb10e27f4 (patch)
tree17a4a0f82b29054f0e5cd2edd8fc4be4b9f48649 /regexec.c
parent87c1d905b4923d9903d603962f0d96171b4adaf3 (diff)
downloadperl-6c3fea77afb1df054862e697daf7fa3cb10e27f4.tar.gz
tidy up init code in regexec() and intuit_start()
Slightly reorganise the set-up code in these two functions, for example by gathering all 'reginfo->foo =' assignments into a single block. This is just swapping the order of a few lines, and shouldn't make any functional difference.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/regexec.c b/regexec.c
index eb95d22497..4fc9444c4e 100644
--- a/regexec.c
+++ b/regexec.c
@@ -643,8 +643,6 @@ Perl_re_intuit_start(pTHX_
PERL_UNUSED_ARG(flags);
PERL_UNUSED_ARG(data);
- reginfo->is_utf8_target = cBOOL(utf8_target);
-
/* CHR_DIST() would be more correct here but it makes things slow. */
if (prog->minlen > strend - strpos) {
DEBUG_EXECUTE_r(PerlIO_printf(Perl_debug_log,
@@ -652,6 +650,7 @@ Perl_re_intuit_start(pTHX_
goto fail;
}
+ reginfo->is_utf8_target = cBOOL(utf8_target);
reginfo->info_aux = NULL;
reginfo->strbeg = strbeg;
reginfo->strend = strend;
@@ -2095,11 +2094,11 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
return 0;
}
- multiline = prog->extflags & RXf_PMf_MULTILINE;
+ DEBUG_EXECUTE_r(
+ debug_start_match(rx, utf8_target, startpos, strend,
+ "Matching");
+ );
- reginfo->prog = rx; /* Yes, sorry that this is confusing. */
- reginfo->intuit = 0;
- reginfo->is_utf8_target = cBOOL(utf8_target);
/* at the end of this function, we'll do a LEAVE_SCOPE(oldsave),
* which will call destuctors to reset PL_regmatch_state, free higher
@@ -2108,11 +2107,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
oldsave = PL_savestack_ix;
- DEBUG_EXECUTE_r(
- debug_start_match(rx, utf8_target, startpos, strend,
- "Matching");
- );
-
+ multiline = prog->extflags & RXf_PMf_MULTILINE;
minlen = prog->minlen;
if (strend - startpos < (minlen+(prog->check_offset_min<0?prog->check_offset_min:0))) {
@@ -2120,7 +2115,6 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
"String too short [regexec_flags]...\n"));
goto phooey;
}
-
/* Check validity of program. */
if (UCHARAT(progi->program) != REG_MAGIC) {
@@ -2129,15 +2123,15 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
RX_MATCH_TAINTED_off(rx);
+ reginfo->prog = rx; /* Yes, sorry that this is confusing. */
+ reginfo->intuit = 0;
+ reginfo->is_utf8_target = cBOOL(utf8_target);
reginfo->is_utf8_pat = cBOOL(RX_UTF8(rx));
reginfo->warned = FALSE;
reginfo->strbeg = strbeg;
reginfo->sv = sv;
reginfo->poscache_maxiter = 0; /* not yet started a countdown */
-
- /* Mark end of string for $ (and such) */
reginfo->strend = strend;
-
/* see how far we have to get to not match where we matched before */
reginfo->till = startpos+minend;