bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19252: [PATCH] dfa: matching at next position or infinit loop in mat


From: Norihiro Tanaka
Subject: bug#19252: [PATCH] dfa: matching at next position or infinit loop in matching mode
Date: Wed, 03 Dec 2014 19:18:45 +0900

On Tue, 2 Dec 2014 08:35:32 -0800
Jim Meyering <address@hidden> wrote:
> I'm not sure I understand the above paragraph.
> Is this what you intended?
> 
>     That will cause an invalid match or an infinite loop.
>     By the way, there is no option to make grep use
>     searching mode rather than matching mode.

That will cause an invalid match or an infinite loop.
By the way, there is no option to make grep use
matching mode rather than searching mode.

> Can you provide a test case to trigger this?
> Is it easier to construct a test case using gawk?

Yes, but it uses neither grep nor gawk.  It uses an auxiliary program
writtern only to accomplish the test, as grep and gawk do *NOT* set 0 to
forth argument of dfacomp.  I added tests of failure and infloop version.

grep:dfasearch.c

  dfa = dfaalloc ();
  dfacomp (pattern, size, dfa, 1);  << not 0
  kwsmusts ();


gawk:re.c
                rp->dfa = true;
                rp->dfareg = dfaalloc();
                dfacomp(buf, len, rp->dfareg, true);  << not 0
        } else
                rp->dfa = false;

I do not change second patch.

Thanks.

Attachment: 0001-dfa-matching-at-next-position-or-infinit-loop-in-mat.patch
Description: Text document

Attachment: 0002-dfa-implification-of-dfaexec.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]