seg. fault with 'cflow -ix^s ' options

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

seg. fault with 'cflow -ix^s ' options

by Laurent F. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

Just to repport that the last GNU cflow (1.1) raises a segmentation fault if used with following option on cflow 1.1 source code

cflow -ix^s cflow-1.1/src/*.c

I do not request to suscribe the bug mailing list.

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

Re: seg. fault with 'cflow -ix^s ' options

by Sergey Poznyakoff :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<lfournie@...> wrote:

> Just to repport that the last GNU cflow (1.1) raises a segmentation fault
> if used with following option on cflow 1.1 source code
>
> cflow -ix^s cflow-1.1/src/*.c

Thank you.  Here is the patch:

Index: src/symbol.c
===================================================================
RCS file: /cvsroot/cflow/cflow/src/symbol.c,v
retrieving revision 1.17
diff -p -u -r1.17 symbol.c
--- src/symbol.c 15 Mar 2006 19:33:01 -0000 1.17
+++ src/symbol.c 6 Sep 2006 15:25:45 -0000
@@ -107,7 +107,9 @@ unlink_symbol(struct table_entry *tp)
 static void
 delete_symbol(struct table_entry *tp)
 {
-     free(unlink_symbol(tp));
+     Symbol *s = unlink_symbol(tp);
+     if (s->ref_line == NULL) /* Symbol is not referenced */
+  free(s);
 }    
 
 static void cleanup_symbol_refs(Symbol *sym);


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