diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2022-03-06 16:37:30 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2022-06-27 21:13:31 +0200 |
commit | 946cedfcfe3bdfd850613c4d891f8abfd6b2cafd (patch) | |
tree | d95372d01134a350b366892ad7b8737f35d5f161 /sysdep/unix | |
parent | 26bc4f9904b014c9949489e8ae28366da473e85d (diff) |
Filter: Implement soft scopes
Soft scopes are anonymous scopes that most likely do not contain any
symbol, so allocating regular scope is postponed when it is really
needed.
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index 392aff9d..f87d0c43 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -116,7 +116,7 @@ add_num_const(char *name, int val, const char *file, const uint line) struct f_val *v = cfg_alloc(sizeof(struct f_val)); *v = (struct f_val) { .type = T_INT, .val.i = val }; struct symbol *sym = cf_get_symbol(name); - if (sym->class && (sym->scope == conf_this_scope)) + if (sym->class && cf_symbol_is_local(sym)) cf_error("Error reading value for %s from %s:%d: already defined", name, file, line); cf_define_symbol(sym, SYM_CONSTANT | T_INT, val, v); |