mirror of
https://sourceware.org/git/glibc.git
synced 2025-12-24 17:51:17 +03:00
Fix up regcomp/regexec
The problem is that parse_bracket_symbol is miscompiled, and it turns
out it is because of an incorrect attribute on re_string_fetch_byte_case.
Unlike re_string_peek_byte_case, this one is really not pure, it modifies memory
(increments pstr->cur_idx), and with the pure attribute GCC assumed it doesn't
and it cached the presumed value of regexp->cur_idx in a variable across the
for (;; ++i)
{
if (i >= BRACKET_NAME_BUF_SIZE)
return REG_EBRACK;
if (token->type == OP_OPEN_CHAR_CLASS)
ch = re_string_fetch_byte_case (regexp);
else
ch = re_string_fetch_byte (regexp);
if (re_string_eoi(regexp))
return REG_EBRACK;
if (ch == delim && re_string_peek_byte (regexp, 0) == ']')
break;
elem->opr.name[i] = ch;
}
This commit is contained in:
committed by
Ulrich Drepper
parent
c0da14cdda
commit
2ba92745c3
@@ -868,7 +868,7 @@ re_string_peek_byte_case (const re_string_t *pstr, int idx)
|
||||
}
|
||||
|
||||
static unsigned char
|
||||
internal_function __attribute ((pure))
|
||||
internal_function
|
||||
re_string_fetch_byte_case (re_string_t *pstr)
|
||||
{
|
||||
if (BE (!pstr->mbs_allocated, 1))
|
||||
|
||||
Reference in New Issue
Block a user