Sfoglia il codice sorgente

Disallow `proc "odin"` procedures to be called in the global scope in variable declarations

gingerBill 1 mese fa
parent
commit
b86932c03c
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      src/check_decl.cpp

+ 6 - 0
src/check_decl.cpp

@@ -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;