bug-grep
[Top][All Lists]
Advanced

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

Re: sync dfaexec from gawk: fixes real bugs in grep


From: Jim Meyering
Subject: Re: sync dfaexec from gawk: fixes real bugs in grep
Date: Fri, 12 Mar 2010 16:40:04 +0100

Paolo Bonzini wrote:
...
> I happily ACK this patchset then, except for asking you to test with
> search.c parts moved to 1/3 and commit that if it passes.

Thanks for the review.
I've teased out one more independent change, below,
then went ahead and squashed 1/3 and 2/3, and pushed the result:

>From 5ad01d89ec6b4004e60d19d3f564efbfa48bf658 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sun, 7 Mar 2010 10:38:29 +0100
Subject: [PATCH] dfa: appease static analyzers

* src/dfa.c (transit_state_singlebyte): Call abort rather
than returning in a "can't happen" scenario.
This stops clang from emitting a false-positive report (I think it
was used-uninitialized) about a caller.
---
 src/dfa.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/dfa.c b/src/dfa.c
index 780b782..8fd00dc 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -2401,8 +2401,10 @@ transit_state_singlebyte (struct dfa *d, int s, unsigned 
char const *p,
       else if (works < 0)
        {
          if (p == buf_end)
-           /* At the moment, it must not happen.  */
-           return TRANSIT_STATE_END_BUFFER;
+           {
+             /* At the moment, it must not happen.  */
+             abort ();
+           }
          works = 0;
        }
       else if (d->fails[works])
--
1.7.0.2.393.gfb6b




reply via email to

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