1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Nested scopes could never have worked. My fault I wrote such a buggy code,

Pavel's fault that he's never tested shadowing of declarations in the filters.

cf_define_symbol() has been modified to check the scope of the symbol it's
given and it if it's an already defined symbol, but in a different scope,
a copy is created in the current scope and redefined to the new meaning,
the consequence being that it cf_define_symbol() now returns the new symbol
you need to use when assigning aux and aux2.
This commit is contained in:
Martin Mares
2000-06-04 19:30:13 +00:00
parent dab6651916
commit 04dc62a011
2 changed files with 40 additions and 21 deletions

View File

@@ -98,7 +98,7 @@ int cf_lex(void);
void cf_lex_init(int is_cli);
struct symbol *cf_find_symbol(byte *c);
struct symbol *cf_default_name(char *template, int *counter);
void cf_define_symbol(struct symbol *symbol, int type, void *def);
struct symbol *cf_define_symbol(struct symbol *symbol, int type, void *def);
void cf_push_scope(struct symbol *);
void cf_pop_scope(void);
struct symbol *cf_walk_symbols(struct config *cf, struct symbol *sym, int *pos);