This commit is contained in:
Ulrich Drepper 1999-08-23 17:31:46 +00:00
parent a286028236
commit 539491ac15
2 changed files with 8 additions and 17 deletions

View File

@ -3,7 +3,6 @@
* posix/regexbug1.c: Make it an error if the test fails. * posix/regexbug1.c: Make it an error if the test fails.
1999-08-23 Andreas Schwab <schwab@suse.de> 1999-08-23 Andreas Schwab <schwab@suse.de>
Ulrich Drepper <drepper@cygnus.com>
* posix/regex.c (re_match_2_internal): Correct check for charset * posix/regex.c (re_match_2_internal): Correct check for charset
after exactn in loop. after exactn in loop.

View File

@ -4833,23 +4833,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
} }
else if ((re_opcode_t) *p2 == charset) else if ((re_opcode_t) *p2 == charset)
{ {
if ((re_opcode_t) p1[3] == exactn) /* We win if the first character of the loop is not part
{ of the charset. */
unsigned char *p1end = &p1[5] + p1[4]; if ((re_opcode_t) p1[3] == exactn
unsigned char *runp1 = &p1[5]; && ! ((int) p2[1] * BYTEWIDTH > (int) p1[5]
&& (p2[2 + p1[5] / BYTEWIDTH]
while (runp1 < p1end) & (1 << (p1[5] % BYTEWIDTH)))))
{
if ((int) p2[1] * BYTEWIDTH <= (int) *runp1
|| (p2[2 + *runp1 / BYTEWIDTH]
& (1 << (*runp1 % BYTEWIDTH))) == 0)
{ {
p[-3] = (unsigned char) pop_failure_jump; p[-3] = (unsigned char) pop_failure_jump;
DEBUG_PRINT1 (" No match => pop_failure_jump.\n"); DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
break;
}
++runp1;
}
} }
else if ((re_opcode_t) p1[3] == charset_not) else if ((re_opcode_t) p1[3] == charset_not)