summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.transmeta.com>2003-04-11 18:52:27 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:00:30 -0700
commit941fd98d91760b6a7e169c7d5ed13745fd5c08a3 (patch)
treeb9032f9508ba7fe0bf99c34392ad8fe36b2ec10e /scope.c
parentMark all function declarations automatically extern unless they (diff)
downloadsparse-941fd98d91760b6a7e169c7d5ed13745fd5c08a3.tar.gz
sparse-941fd98d91760b6a7e169c7d5ed13745fd5c08a3.tar.bz2
sparse-941fd98d91760b6a7e169c7d5ed13745fd5c08a3.zip
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 'scope.c')
-rw-r--r--scope.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index de240f0..79db655 100644
--- a/scope.c
+++ b/scope.c
@@ -20,6 +20,7 @@ struct scope *block_scope = &toplevel_scope,
void bind_scope(struct symbol *sym, struct scope *scope)
{
+ sym->scope = scope;
add_symbol(&scope->symbols, sym);
}