mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
[BZ #558]
Update. 2005-01-27 Paolo Bonzini <bonzini@gnu.org> [BZ #558] * posix/regcomp.c (calc_inveclosure): Return reg_errcode_t. Initialize the node sets in dfa->inveclosures. (analyze): Initialize inveclosures only if it is needed. Check errors from calc_inveclosure. * posix/regex_internal.c (re_dfa_add_node): Do not initialize the inveclosure node set. * posix/regexec.c (re_search_internal): If nmatch includes unused subexpressions, reset them to { rm_so: -1, rm_eo: -1 } here. * posix/regcomp.c (parse_bracket_exp) [!RE_ENABLE_I18N]: Do build a SIMPLE_BRACKET token. * posix/regexec.c (transit_state_mb): Do not examine nodes where ACCEPT_MB is not set.
This commit is contained in:
@ -1339,7 +1339,7 @@ re_dfa_add_node (dfa, token)
|
||||
{
|
||||
int new_nodes_alloc = dfa->nodes_alloc * 2;
|
||||
int *new_nexts, *new_indices;
|
||||
re_node_set *new_edests, *new_eclosures, *new_inveclosures;
|
||||
re_node_set *new_edests, *new_eclosures;
|
||||
|
||||
re_token_t *new_array = re_realloc (dfa->nodes, re_token_t,
|
||||
new_nodes_alloc);
|
||||
@ -1350,17 +1350,13 @@ re_dfa_add_node (dfa, token)
|
||||
new_indices = re_realloc (dfa->org_indices, int, new_nodes_alloc);
|
||||
new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc);
|
||||
new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc);
|
||||
new_inveclosures = re_realloc (dfa->inveclosures, re_node_set,
|
||||
new_nodes_alloc);
|
||||
if (BE (new_nexts == NULL || new_indices == NULL
|
||||
|| new_edests == NULL || new_eclosures == NULL
|
||||
|| new_inveclosures == NULL, 0))
|
||||
|| new_edests == NULL || new_eclosures == NULL, 0))
|
||||
return -1;
|
||||
dfa->nexts = new_nexts;
|
||||
dfa->org_indices = new_indices;
|
||||
dfa->edests = new_edests;
|
||||
dfa->eclosures = new_eclosures;
|
||||
dfa->inveclosures = new_inveclosures;
|
||||
dfa->nodes_alloc = new_nodes_alloc;
|
||||
}
|
||||
dfa->nodes[dfa->nodes_len] = token;
|
||||
@ -1372,7 +1368,6 @@ re_dfa_add_node (dfa, token)
|
||||
dfa->nexts[dfa->nodes_len] = -1;
|
||||
re_node_set_init_empty (dfa->edests + dfa->nodes_len);
|
||||
re_node_set_init_empty (dfa->eclosures + dfa->nodes_len);
|
||||
re_node_set_init_empty (dfa->inveclosures + dfa->nodes_len);
|
||||
return dfa->nodes_len++;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user