summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2000-11-17 12:28:02 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-18 00:32:54 +0000
commitcb434fcc98ac25f5b12abd45117055b5f6caa477 (patch)
tree271f4814cbed3c622df6c7d6df0a80542cca6454 /regexec.c
parent2f3a5373a206f22b10d28792b4ecbe362c59c3bd (diff)
downloadperl-cb434fcc98ac25f5b12abd45117055b5f6caa477.tar.gz
restore match data on backtracing
Message-ID: <20001117172802.A1032@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@7733
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/regexec.c b/regexec.c
index a71f1d8601..c0d0097fa4 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2596,12 +2596,18 @@ S_regmatch(pTHX_ regnode *prog)
case CURLYX: {
CURCUR cc;
CHECKPOINT cp = PL_savestack_ix;
+ /* No need to save/restore up to this paren */
+ I32 parenfloor = scan->flags;
if (OP(PREVOPER(next)) == NOTHING) /* LONGJMP */
next += ARG(next);
cc.oldcc = PL_regcc;
PL_regcc = &cc;
- cc.parenfloor = *PL_reglastparen;
+ /* XXXX Probably it is better to teach regpush to support
+ parenfloor > PL_regsize... */
+ if (parenfloor > *PL_reglastparen)
+ parenfloor = *PL_reglastparen; /* Pessimization... */
+ cc.parenfloor = parenfloor;
cc.cur = -1;
cc.min = ARG1(scan);
cc.max = ARG2(scan);