[bug report] A part of the tree branch is lacked with the --tree option.

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

[bug report] A part of the tree branch is lacked with the --tree option.

by Shigio YAMAGUCHI-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hello,
Though I might be misunderstanding about it, I might have found a bug.

Version: cflow-1.3
Environment: FreeBSD-6.1 RELEASE

1. Situation of the trouble
===========================

A '|' is lacked in the 3 line of the output.

% cat -n test.c
     1  int main()
     2  {
     3          hello(NULL);
     4          printf("Hello\n");
     5  }
     6  hello(const char *data)
     7  {
     8          printf("Hello\n");
     9  }
% cflow --tree --number test.c
    1 +-main() <int main () at test.c:1>
    2   +-hello() <hello (const char *data) at test.c:6>
    3     \-printf()      <=========================== A '|' is lacked
    4   \-printf()

2. Correction of the trouble
============================

o Fixed version

% cflow --tree --number test.c
    1 +-main() <int main () at test.c:1>
    2   +-hello() <hello (const char *data) at test.c:6>
    3   | \-printf()
    4   \-printf()
% _

This is the test program.
-------------------------------------------------
int main()
{
        hello(NULL);
        printf("Hello\n");
}
hello(const char *data)
{
        printf("Hello\n");
}
-------------------------------------------------

Here is the patch.
Thank you for your great tool.

Best Regards,
Shigio Yamaguchi


*** output.c.orig Sun Jun 28 21:53:58 2009
--- output.c Wed Aug 17 16:44:03 2011
***************
*** 327,333 ****
   return;
       set_active(sym);
       for (p = linked_list_head(sym->callee); p; p = p->next) {
!  set_level_mark(lev+1, is_printable(p->next));
   direct_tree(lev+1, is_last(p), (Symbol*)p->data);
       }
       clear_active(sym);
--- 327,333 ----
   return;
       set_active(sym);
       for (p = linked_list_head(sym->callee); p; p = p->next) {
!  set_level_mark(lev+1, !is_last(p));
   direct_tree(lev+1, is_last(p), (Symbol*)p->data);
       }
       clear_active(sym);
***************
*** 351,357 ****
   return;
       set_active(sym);
       for (p = linked_list_head(sym->caller); p; p = p->next) {
!  set_level_mark(lev+1, is_printable(p->next));
   inverted_tree(lev+1, is_last(p), (Symbol*)p->data);
       }
       clear_active(sym);
--- 351,357 ----
   return;
       set_active(sym);
       for (p = linked_list_head(sym->caller); p; p = p->next) {
!  set_level_mark(lev+1, !is_last(p));
   inverted_tree(lev+1, is_last(p), (Symbol*)p->data);
       }
       clear_active(sym);
--
Shigio YAMAGUCHI <shigio@...>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

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

Re: [bug report] A part of the tree branch is lacked with the --tree option.

by Sergey Poznyakoff-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hi Shigio!

> Though I might be misunderstanding about it, I might have found a bug.

Yes, you are right, that's definitely a bug.  Thanks a lot for the patch
and the testcase.  I have installed both.

Regards,
Sergey

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