diff --git a/conf/cf-lex.l b/conf/cf-lex.l index 72582083..b7ecfb7b 100644 --- a/conf/cf-lex.l +++ b/conf/cf-lex.l @@ -893,8 +893,15 @@ cf_swap_soft_scope(struct config *conf) void cf_enter_filters(void) { - ASSERT_DIE(!new_config->allow_attributes); + ASSERT_DIE(!cf_maybe_enter_filters()); +} + +int +cf_maybe_enter_filters(void) +{ + int o = new_config->allow_attributes; new_config->allow_attributes = 1; + return o; } /** @@ -903,8 +910,15 @@ cf_enter_filters(void) void cf_exit_filters(void) { - ASSERT_DIE(new_config->allow_attributes); + ASSERT_DIE(cf_maybe_exit_filters()); +} + +int +cf_maybe_exit_filters(void) +{ + int o = new_config->allow_attributes; new_config->allow_attributes = 0; + return o; } diff --git a/conf/conf.h b/conf/conf.h index f6e9069d..ea4aac35 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -159,6 +159,8 @@ struct sym_scope { void cf_enter_filters(void); void cf_exit_filters(void); +int cf_maybe_enter_filters(void); +int cf_maybe_exit_filters(void); extern pool *global_root_scope_pool; extern linpool *global_root_scope_linpool; diff --git a/conf/confbase.Y b/conf/confbase.Y index 9324c559..845070b2 100644 --- a/conf/confbase.Y +++ b/conf/confbase.Y @@ -28,6 +28,8 @@ CF_HDR CF_DEFINES +static _Bool this_sadr_from_hack_active; + static void check_u16(uint val) { @@ -119,7 +121,7 @@ CF_DECLS %type expr bool pxlen4 %type