summaryrefslogtreecommitdiff
path: root/conf
diff options
context:
space:
mode:
Diffstat (limited to 'conf')
-rw-r--r--conf/cf-lex.l6
-rw-r--r--conf/conf.h7
2 files changed, 10 insertions, 3 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index d6f46223..28d9ba50 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -812,7 +812,7 @@ cf_push_soft_scope(void)
if (conf_this_scope->soft_scopes < 0xfe)
conf_this_scope->soft_scopes++;
else
- cf_push_scope(NULL);
+ cf_push_block_scope();
}
/**
@@ -826,7 +826,7 @@ cf_pop_soft_scope(void)
if (conf_this_scope->soft_scopes)
conf_this_scope->soft_scopes--;
else
- cf_pop_scope();
+ cf_pop_block_scope();
}
/**
@@ -841,7 +841,7 @@ cf_swap_soft_scope(void)
if (conf_this_scope->soft_scopes)
{
conf_this_scope->soft_scopes--;
- cf_push_scope(NULL);
+ cf_push_block_scope();
}
}
diff --git a/conf/conf.h b/conf/conf.h
index be46f172..96c873df 100644
--- a/conf/conf.h
+++ b/conf/conf.h
@@ -134,6 +134,7 @@ struct sym_scope {
struct symbol *name; /* Name of this scope */
uint slots; /* Variable slots */
byte active; /* Currently entered */
+ byte block; /* No independent stack frame */
byte soft_scopes; /* Number of soft scopes above */
};
@@ -220,6 +221,12 @@ void cf_pop_scope(void);
void cf_push_soft_scope(void);
void cf_pop_soft_scope(void);
+static inline void cf_push_block_scope(void)
+{ cf_push_scope(NULL); conf_this_scope->block = 1; }
+
+static inline void cf_pop_block_scope(void)
+{ ASSERT(conf_this_scope->block); cf_pop_scope(); }
+
char *cf_symbol_class_name(struct symbol *sym);
/* Parser */