diff options
| -rw-r--r-- | lib.c | 3 | ||||
| -rw-r--r-- | scope.c | 7 | ||||
| -rw-r--r-- | scope.h | 1 |
3 files changed, 9 insertions, 2 deletions
@@ -677,9 +677,8 @@ struct symbol_list * __sparse(char **argv) *argv++ = next; } while (next); - start_file_scope(); + new_file_scope(); res = sparse_file(filename); - end_file_scope(); /* Drop the tokens for this file after parsing */ clear_token_alloc(); @@ -96,6 +96,13 @@ void end_file_scope(void) end_scope(&file_scope); } +void new_file_scope(void) +{ + if (file_scope != &builtin_scope) + end_file_scope(); + start_file_scope(); +} + void end_symbol_scope(void) { end_scope(&block_scope); @@ -28,6 +28,7 @@ static inline int toplevel(struct scope *scope) extern void start_file_scope(void); extern void end_file_scope(void); +extern void new_file_scope(void); extern void start_symbol_scope(void); extern void end_symbol_scope(void); |
