mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +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.scope = d->scope;
|
||||||
c.decl = d;
|
c.decl = d;
|
||||||
c.type_level = 0;
|
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->parent_proc_decl = c.curr_proc_decl;
|
||||||
e->state = EntityState_InProgress;
|
e->state = EntityState_InProgress;
|
||||||
|
|||||||
Reference in New Issue
Block a user