From b4a80f4239b19fea4d2cc3e9d197f24b809f0624 Mon Sep 17 00:00:00 2001 From: Daniel Llorens Date: Mon, 16 Aug 2021 13:23:27 +0200 Subject: Update gnulib to 8f4538a53d64054ae2fc8b86c0f87c418c6176e6 Includes gnulib:0c907f7da13232908f05c415b8cec56024071906 to fix #49930 https://lists.gnu.org/archive/html/bug-guile/2021-08/msg00003.html. --- lib/regexec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/regexec.c') diff --git a/lib/regexec.c b/lib/regexec.c index 6309deac8..5e4eb497a 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -1220,9 +1220,13 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs, { re_node_set *cur_nodes = &mctx->state_log[*pidx]->nodes; re_node_set *edests = &dfa->edests[node]; - bool ok = re_node_set_insert (eps_via_nodes, node); - if (__glibc_unlikely (! ok)) - return -2; + + if (! re_node_set_contains (eps_via_nodes, node)) + { + bool ok = re_node_set_insert (eps_via_nodes, node); + if (__glibc_unlikely (! ok)) + return -2; + } /* Pick a valid destination, or return -1 if none is found. */ Idx dest_node = -1; @@ -1414,7 +1418,7 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch, update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch); if ((idx == pmatch[0].rm_eo && cur_node == mctx->last_node) - || re_node_set_contains (&eps_via_nodes, cur_node)) + || (fs && re_node_set_contains (&eps_via_nodes, cur_node))) { Idx reg_idx; cur_node = -1; -- cgit v1.2.1