aboutsummaryrefslogtreecommitdiff
path: root/src/compiler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler.c')
-rw-r--r--src/compiler.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/compiler.c b/src/compiler.c
index 881326c..d865ea5 100644
--- a/src/compiler.c
+++ b/src/compiler.c
@@ -171,13 +171,14 @@ struct scope *process_file(const char *file)
return *exists;
} else {
struct scope *scope = create_scope();
- if (process(scope, base)) {
- destroy_scope(scope);
- free(real);
- goto out;
- }
+ if (scopes_len(&scopes) == 0)
+ scope_set_flags(scope, SCOPE_ROOT);
scopes_insert(&scopes, real, scope);
+
+ if (process(scope, base))
+ goto out;
+
res_destroy(r);
return scope;
}