summaryrefslogtreecommitdiff
path: root/sysdep
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2022-03-06 16:37:30 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2022-06-27 21:13:31 +0200
commit946cedfcfe3bdfd850613c4d891f8abfd6b2cafd (patch)
treed95372d01134a350b366892ad7b8737f35d5f161 /sysdep
parent26bc4f9904b014c9949489e8ae28366da473e85d (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')
-rw-r--r--sysdep/unix/main.c2
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);