summaryrefslogtreecommitdiffstats
path: root/otherlibs
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2002-12-16 11:00:45 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2002-12-16 11:00:45 +0000
commit37eb6033ed7160781e3c3a1f20895f6d96d9e796 (patch)
tree46b776c630ac87223d7bdfe847a7a65e4a11b11c /otherlibs
parent854e427a99cf44e6833b9fad6dfdf39e436aef57 (diff)
Bug dans les nouvelles instructions GOTO_STAR et GOTO_PLUS
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5345 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs')
-rw-r--r--otherlibs/str/strstubs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/otherlibs/str/strstubs.c b/otherlibs/str/strstubs.c
index 820da980c..77442a475 100644
--- a/otherlibs/str/strstubs.c
+++ b/otherlibs/str/strstubs.c
@@ -59,9 +59,9 @@ enum {
GOTO, /* unconditional branch */
PUSHBACK, /* record a backtrack point --
where to jump in case of failure */
- GOTO_STAR, /* like goto, except that we backtrack if no
+ GOTO_STAR, /* like goto, except that we fall through if no
characters were consumed since last PUSHBACK */
- GOTO_PLUS, /* like goto, except that we backtrack if no
+ GOTO_PLUS, /* like goto, except that we fall through if no
characters were consumed since penultimate PUSHBACK */
};
@@ -269,14 +269,14 @@ static int re_match(value re,
break;
case GOTO_STAR: {
struct backtrack_point * p = re_previous_backtrack_point(sp, stack, 1);
- if (p != NULL && txt == p->txt) goto backtrack;
- pc = pc + SignedArg(instr);
+ if (p == NULL || txt > p->txt)
+ pc = pc + SignedArg(instr);
break;
}
case GOTO_PLUS: {
struct backtrack_point * p = re_previous_backtrack_point(sp, stack, 2);
- if (p != NULL && txt == p->txt) goto backtrack;
- pc = pc + SignedArg(instr);
+ if (p == NULL || txt > p->txt)
+ pc = pc + SignedArg(instr);
break;
}
default: