summaryrefslogtreecommitdiff
path: root/posix/regex_internal.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-12-17 10:58:04 +0000
committerUlrich Drepper <drepper@redhat.com>2002-12-17 10:58:04 +0000
commita7d5c29129aab547faff1fd2cfe0d9095ec4689b (patch)
tree9890ba8c05b46ae778b6529a095f32d12096a459 /posix/regex_internal.c
parent0bc02a400815ace6f0f9265a681e2b0bd92ad683 (diff)
Update.
2002-12-17 Isamu Hasegawa <isamu@yamato.ibm.com> * 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.
Diffstat (limited to 'posix/regex_internal.c')
-rw-r--r--posix/regex_internal.c9
1 files changed, 6 insertions, 3 deletions
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;