aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 75ee19cf..635e0d6d 100644
--- a/scope.c
+++ b/scope.c
@@ -162,3 +162,12 @@ int is_outer_scope(struct scope *scope)
return 1;
}
+int is_in_scope(struct scope *outer, struct scope *inner)
+{
+ while (inner != outer) {
+ if (inner == function_scope)
+ return 0;
+ inner = inner->next;
+ }
+ return 1;
+}