Allow nested procedures to access @(static) and @(thread_local) variables

This commit is contained in:
gingerBill
2020-12-04 11:28:14 +00:00
parent 0ef02e6737
commit 05a3bdad58
3 changed files with 35 additions and 14 deletions
+8 -3
View File
@@ -368,9 +368,14 @@ void scope_lookup_parent(Scope *scope, String const &name, Scope **scope_, Entit
if (e->kind == Entity_Label) {
continue;
}
if (e->kind == Entity_Variable &&
!(e->scope->flags&ScopeFlag_File)) {
continue;
if (e->kind == Entity_Variable) {
if (e->scope->flags&ScopeFlag_File) {
// Global variables are file to access
} else if (e->flags&EntityFlag_Static) {
// Allow static/thread_local variables to be referenced
} else {
continue;
}
}
}