path: root/tests/
Side-by-side diff
Diffstat (limited to 'tests/') (more/less context) (ignore whitespace changes)
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/ b/tests/
new file mode 100644
index 0000000..073719b
--- a/dev/null
+++ b/tests/
@@ -0,0 +1,63 @@
+# This file is part of GNU cflow testsuite. -*- Autotest -*-
+# Copyright (C) 2006 Sergey Poznyakoff
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2, or (at
+# your option) any later version.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# General Public License for more details.
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 USA.
+AT_SETUP([Static symbols with forward decls and -i^s])
+AT_KEYWORDS([static fdecl])
+# Up to version 1.1 static symbols with forward declarations caused
+# segmentation faults when used with -i^s.
+# Synopsis: Normally static functions are not added to callee lists
+# of their callers in -i^s mode (see add_reference() and call() in parser.c),
+# therefore cflow 1.1 assumed it was safe to free them in static_processor().
+# However, there is an important exception: if the function storage type is
+# not known at the time of reference. Such functions are added to callee lists
+# and freeing them causes coredumps.
+# To reproduce the case we need two source files: first with the actual test
+# program and the second, empty, one, whose purpose is to trigger additional
+# memory allocations after symbol deletion.
+# Reported by: Laurent Fournie
+# References: <>
+static void foo();
+ foo();
+static void
+ int x = 1;
+[bar() <int bar () at prog:5>:])

Return to:

Send suggestions and report system problems to the System administrator.