From a7d5c29129aab547faff1fd2cfe0d9095ec4689b Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 17 Dec 2002 10:58:04 +0000 Subject: Update. 2002-12-17 Isamu Hasegawa * posix/regcomp.c (free_workarea_compile): Free the new member ORG_INDICES. (analyze): Initialize ORG_INDICES. (duplicate_node_closure): Search for a existing node, which is duplicated from the node ORG_DEST and satisfies the constraint CONSTRAINT. And use it to avoid inifimite loop. (search_duplicated_node): New function. (duplicate_node): Store the index of the original node. * posix/regex_internal.c (re_dfa_add_node): Realloc ORG_INDICES if needed. * posix/regex_internal.h (re_dfa_t): Add new members. --- posix/regex_internal.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'posix/regex_internal.c') diff --git a/posix/regex_internal.c b/posix/regex_internal.c index a9559e2768..a3ce236c54 100644 --- a/posix/regex_internal.c +++ b/posix/regex_internal.c @@ -986,19 +986,22 @@ re_dfa_add_node (dfa, token, mode) dfa->nodes = new_array; if (mode) { - int *new_nexts; + int *new_nexts, *new_indices; re_node_set *new_edests, *new_eclosures, *new_inveclosures; new_nexts = re_realloc (dfa->nexts, int, dfa->nodes_alloc); + new_indices = re_realloc (dfa->org_indices, int, dfa->nodes_alloc); new_edests = re_realloc (dfa->edests, re_node_set, dfa->nodes_alloc); new_eclosures = re_realloc (dfa->eclosures, re_node_set, dfa->nodes_alloc); new_inveclosures = re_realloc (dfa->inveclosures, re_node_set, dfa->nodes_alloc); - if (BE (new_nexts == NULL || new_edests == NULL - || new_eclosures == NULL || new_inveclosures == NULL, 0)) + if (BE (new_nexts == NULL || new_indices == NULL + || new_edests == NULL || new_eclosures == NULL + || new_inveclosures == 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; -- cgit 1.4.1