Mercurial > hg > octave-lyh > gnulib-hg
changeset 12829:971957a253f8
regcomp.c: do not ignore internal return values
* lib/regcomp.c: Do not ignore internal return values.
This is from glibc's 2da42bc06566bc89785e580fa1ac89b4c9f2a63c,
but without its white-space changes and spelling fixes.
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Tue, 19 Jan 2010 09:18:19 +0100 |
parents | 6c20461f3ecf |
children | b8269a183e3e |
files | ChangeLog lib/regcomp.c |
diffstat | 2 files changed, 14 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2010-01-28 Jim Meyering <meyering@redhat.com> + regcomp.c: do not ignore internal return values + * lib/regcomp.c: Do not ignore internal return values. + This is from glibc's 2da42bc06566bc89785e580fa1ac89b4c9f2a63c, + but without its white-space changes and spelling fixes. + regex_internal.h: define __attribute_warn_unused_result__ * lib/regex_internal.h (__attribute_warn_unused_result__): Define.
--- a/lib/regcomp.c +++ b/lib/regcomp.c @@ -1021,7 +1021,11 @@ Idx dest_idx = dfa->edests[node_idx].elems[0]; if (!re_node_set_contains (&init_nodes, dest_idx)) { - re_node_set_merge (&init_nodes, dfa->eclosures + dest_idx); + reg_errcode_t err = re_node_set_merge (&init_nodes, + dfa->eclosures + + dest_idx); + if (err != REG_NOERROR) + return err; i = 0; } } @@ -1446,7 +1450,7 @@ case OP_BACK_REF: dfa->nexts[idx] = node->next->node_idx; if (node->token.type == OP_BACK_REF) - re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]); + err = re_node_set_init_1 (dfa->edests + idx, dfa->nexts[idx]); break; default: @@ -1726,7 +1730,9 @@ else eclosure_elem = dfa->eclosures[edest]; /* Merge the epsilon closure of `edest'. */ - re_node_set_merge (&eclosure, &eclosure_elem); + err = re_node_set_merge (&eclosure, &eclosure_elem); + if (BE (err != REG_NOERROR, 0)) + return err; /* If the epsilon closure of `edest' is incomplete, the epsilon closure of this node is also incomplete. */ if (dfa->eclosures[edest].nelem == 0)