summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2006-10-30 21:15:13 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-30 17:36:18 +0000
commit40d049e43280582bb162c511cc362c246f19862a (patch)
treec9814e23bdc818ced498f5ecc2141867f3525af8 /regexec.c
parentee4d86fe475b15ddee109f44751faf957c1e66af (diff)
downloadperl-40d049e43280582bb162c511cc362c246f19862a.tar.gz
The first patch from:
Subject: [PATCH] regex engine optimiser should grok subroutine patterns, and, name subroutine regops more intuitively Message-ID: <9b18b3110610300915x3abf6cddu9c2071a70bea48e1@mail.gmail.com> p4raw-id: //depot/perl@29161
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/regexec.c b/regexec.c
index 17d0e01906..d57fd35bc5 100644
--- a/regexec.c
+++ b/regexec.c
@@ -331,7 +331,11 @@ Perl_pregexec(pTHX_ register regexp *prog, char *stringarg, register char *stren
RExen without fixed substrings. Similarly, it is assumed that
lengths of all the strings are no more than minlen, thus they
cannot come from lookahead.
- (Or minlen should take into account lookahead.) */
+ (Or minlen should take into account lookahead.)
+ NOTE: Some of this comment is not correct. minlen does now take account
+ of lookahead/behind. Further research is required. -- demerphq
+
+*/
/* A failure to find a constant substring means that there is no need to make
an expensive call to REx engine, thus we celebrate a failure. Similarly,
@@ -4450,6 +4454,10 @@ NULL
curly_try_B_max:
/* a successful greedy match: now try to match B */
+ if (cur_eval && cur_eval->u.eval.close_paren &&
+ cur_eval->u.eval.close_paren == ST.paren) {
+ goto fake_end;
+ }
{
UV c = 0;
if (ST.c1 != CHRTEST_VOID)
@@ -4459,10 +4467,6 @@ NULL
/* If it could work, try it. */
if (ST.c1 == CHRTEST_VOID || c == (UV)ST.c1 || c == (UV)ST.c2) {
CURLY_SETPAREN(ST.paren, ST.count);
- if (cur_eval && cur_eval->u.eval.close_paren &&
- cur_eval->u.eval.close_paren == ST.paren) {
- goto fake_end;
- }
PUSH_STATE_GOTO(CURLY_B_max, ST.B);
/* NOTREACHED */
}