summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 0774cfa..5416883 100644
--- a/scope.c
+++ b/scope.c
@@ -113,4 +113,11 @@ static bool each_enter(Expression *e) {
static void each_exit(Expression *e) {
assert(e->kind == EXPR_EACH);
+ EachExpr *ea = &e->each;
+ if (ea->index) {
+ arr_remove_last(&ea->index->decls);
+ }
+ if (ea->value) {
+ arr_remove_last(&ea->value->decls);
+ }
}