aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test-parsing.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@penguin.transmeta.com>2003-03-25 18:34:15 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 20:59:47 -0700
commit38795344d7b03fc340b5cabb0a38e22d327836d9 (patch)
tree3a77611bca58b5dbd620b2bf4dd9f285d2b185d5 /test-parsing.c
parentada22defe98209bfc1c4285f1b76a548552e28cf (diff)
downloadsparse-38795344d7b03fc340b5cabb0a38e22d327836d9.tar.gz
Fix indirect type parsing (functions, arrays, bitfields). Update
users to match. Examine array type sizes. Evaluate 'sizeof()', and realize that you can dereference arrays as well as pointers.
Diffstat (limited to 'test-parsing.c')
-rw-r--r--test-parsing.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/test-parsing.c b/test-parsing.c
index 9f05e9f9..bc083979 100644
--- a/test-parsing.c
+++ b/test-parsing.c
@@ -56,12 +56,14 @@ static void clean_up_statement(struct statement *stmt, void *_parent, int flags)
static void clean_up_symbol(struct symbol *sym, void *_parent, int flags)
{
struct symbol *parent = _parent;
+ struct symbol *type;
examine_symbol_type(sym);
- if (sym->type == SYM_FN) {
- symbol_iterate(sym->arguments, clean_up_symbol, parent);
- if (sym->stmt)
- simplify_statement(sym->stmt, sym);
+ type = sym->ctype.base_type;
+ if (type && type->type == SYM_FN) {
+ symbol_iterate(type->arguments, clean_up_symbol, parent);
+ if (type->stmt)
+ simplify_statement(type->stmt, sym);
}
}