GNU bug report logs - #17066
a DFA state which is built previously may be re-built in non-UTF8 locales

Previous Next

Package: grep;

Reported by: Norihiro Tanaka <noritnk <at> kcn.ne.jp>

Date: Sat, 22 Mar 2014 07:00:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 17066 <at> debbugs.gnu.org (full text, mbox):

From: Paolo Bonzini <bonzini <at> gnu.org>
To: Norihiro Tanaka <noritnk <at> kcn.ne.jp>, 17066 <at> debbugs.gnu.org
Subject: Re: bug#17066: a DFA state which is built previously may be re-built
 in non-UTF8 locales
Date: Tue, 01 Apr 2014 10:47:27 +0200
Il 22/03/2014 07:59, Norihiro Tanaka ha scritto:
>
> From fba7984fa2a5baff18e1b48611c3d7fb3701255b Mon Sep 17 00:00:00 2001
> From: Norihiro Tanaka <noritnk <at> kcn.ne.jp>
> Date: Sat, 22 Mar 2014 15:11:52 +0900
> Subject: [PATCH] grep: avoid to re-build a state built previously.
>
> * src/dfa.c (dfaexec): avoid to re-build a state built previously.
> ---
>  src/dfa.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/dfa.c b/src/dfa.c
> index 5e60cd5..8261849 100644
> --- a/src/dfa.c
> +++ b/src/dfa.c
> @@ -3501,7 +3501,8 @@ dfaexec (struct dfa *d, char const *begin, char *end,
>
>        if (s >= 0)
>          {
> -          build_state (s, d);
> +          if (!d->trans[s])
> +            build_state (s, d);
>            trans = d->trans;
>            continue;
>          }
> -- 1.9.1

Thanks, I'll apply this patch.

Paolo




This bug report was last modified 11 years and 48 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.