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
master
Xavier Leroy 2002-12-16 11:00:45 +00:00
parent 854e427a99
commit 37eb6033ed
1 changed files with 6 additions and 6 deletions

View File

@ -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: