diff options
author | Linus Torvalds <torvalds@home.transmeta.com> | 2003-04-11 18:52:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:00:30 -0700 |
commit | 941fd98d91760b6a7e169c7d5ed13745fd5c08a3 (patch) | |
tree | b9032f9508ba7fe0bf99c34392ad8fe36b2ec10e /symbol.c | |
parent | affb6d1c90f57ae80fab6b74d0272f7bc9cf683b (diff) | |
download | sparse-941fd98d91760b6a7e169c7d5ed13745fd5c08a3.tar.gz |
Oops. Bad scoping for iterators and switch() statements. We didn't
close the scope properly at the end (we started a new one instead).
Make all non-static functions external.
And always check the declarator against previous symbols when finding
a new symbol. We want to verify that we don't have duplicates.
Diffstat (limited to 'symbol.c')
-rw-r--r-- | symbol.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -267,6 +267,24 @@ struct symbol *examine_symbol_type(struct symbol * sym) return sym; } +void check_declaration(struct symbol *sym) +{ + struct symbol *next = sym; + + while ((next = next->next_id) != NULL) { + if (next->namespace != sym->namespace) + continue; + if (sym->scope == next->scope) { + sym->same_symbol = next; + return; + } + if (sym->ctype.modifiers & next->ctype.modifiers & MOD_EXTERN) { + sym->same_symbol = next; + return; + } + } +} + void bind_symbol(struct symbol *sym, struct ident *ident, enum namespace ns) { struct scope *scope; |