parser's bug (Segmentation fault)

View: New views
2 Messages — Rating Filter:   Alert me  

parser's bug (Segmentation fault)

by Shigio Yamaguchi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
I believe I have found a bug.

[Reproduction method on GNU/Linux]

$ cflow --version
cflow (GNU cflow) 1.0
$ cflow test.h
Segmentation fault
$ cat test.h
a(x,void());
$

Thank you for your wonderful cflow!
--
Shigio YAMAGUCHI <shigio@...> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


_______________________________________________
Bug-cflow mailing list
Bug-cflow@...
http://lists.gnu.org/mailman/listinfo/bug-cflow

Re: parser's bug (Segmentation fault)

by Sergey Poznyakoff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Shigio YAMAGUCHI <shigio@...> wrote:

> I believe I have found a bug.

Yes, you did. Here is the fix:

Index: src/parser.c
===================================================================
RCS file: /cvsroot/cflow/cflow/src/parser.c,v
retrieving revision 1.33
diff -p -u -r1.33 parser.c
--- src/parser.c 5 Oct 2005 12:30:01 -0000 1.33
+++ src/parser.c 3 Nov 2005 14:21:29 -0000
@@ -748,8 +748,7 @@ dcl(Ident *idptr)
        else if (type != MODIFIER)
     break;
   } else if (tok.type == ')') {
-       putback();
-       break;
+       return 1;
   }
      }
      if (idptr && idptr->type_end == -1)


Domo arigato!

Regards,
Sergey


_______________________________________________
Bug-cflow mailing list
Bug-cflow@...
http://lists.gnu.org/mailman/listinfo/bug-cflow