summaryrefslogtreecommitdiffstats
path: root/src/parser_bison.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser_bison.y')
-rw-r--r--src/parser_bison.y3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/parser_bison.y b/src/parser_bison.y
index 763c1b2d..f5f6bf04 100644
--- a/src/parser_bison.y
+++ b/src/parser_bison.y
@@ -80,12 +80,11 @@ static int open_scope(struct parser_state *state, struct scope *scope)
static void close_scope(struct parser_state *state)
{
- if (state->scope_err) {
+ if (state->scope_err || state->scope == 0) {
state->scope_err = false;
return;
}
- assert(state->scope > 0);
state->scope--;
}