mirror of
https://github.com/odin-lang/Odin.git
synced 2026-04-20 05:20:28 +00:00
Disallow proc "odin" procedures to be called in the global scope in variable declarations
This commit is contained in:
@@ -1851,6 +1851,12 @@ gb_internal void check_entity_decl(CheckerContext *ctx, Entity *e, DeclInfo *d,
|
||||
c.scope = d->scope;
|
||||
c.decl = d;
|
||||
c.type_level = 0;
|
||||
c.curr_proc_calling_convention = ProcCC_Contextless;
|
||||
|
||||
auto prev_flags = c.scope->flags;
|
||||
defer (c.scope->flags = prev_flags);
|
||||
c.scope->flags &= ~ScopeFlag_ContextDefined;
|
||||
|
||||
|
||||
e->parent_proc_decl = c.curr_proc_decl;
|
||||
e->state = EntityState_InProgress;
|
||||
|
||||
Reference in New Issue
Block a user