diff options
| author | gingerBill <bill@gingerbill.org> | 2020-12-04 11:28:14 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2020-12-04 11:28:14 +0000 |
| commit | 05a3bdad588d7d1194d4705b4f60506208e36b39 (patch) | |
| tree | 21b20160e6b1c8200b4b02e47a10d4139c65538c /src/checker.cpp | |
| parent | 0ef02e6737ffc382a00fc549811e9fca49bd4089 (diff) | |
Allow nested procedures to access `@(static)` and `@(thread_local)` variables
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 901f5439c..c1a107c15 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -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; + } } } |