diff options
| author | gingerBill <bill@gingerbill.org> | 2018-01-28 09:19:23 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-01-28 09:19:23 +0000 |
| commit | f661ae9d095b4b7d6e8a51f7b539612afe4162a0 (patch) | |
| tree | e3206c3bf2657488bcceeaf0166c8a0dd036dad8 /src/check_decl.cpp | |
| parent | bee4cb57f20d0310a3bbaa39ccdfa1165d82974a (diff) | |
Fix issue with proc group cycles #176
Diffstat (limited to 'src/check_decl.cpp')
| -rw-r--r-- | src/check_decl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/check_decl.cpp b/src/check_decl.cpp index 549cdd9e1..75d37a22d 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -718,6 +718,10 @@ void check_proc_group_decl(Checker *c, Entity *pg_entity, DeclInfo *d) { array_init(&pge->entities, c->allocator, pg->args.count); + // NOTE(bill): This must be set here to prevent cycles in checking if someone + // places the entity within itself + pg_entity->type = t_invalid; + PtrSet<Entity *> entity_map = {}; ptr_set_init(&entity_map, heap_allocator()); defer (ptr_set_destroy(&entity_map)); @@ -815,7 +819,6 @@ void check_proc_group_decl(Checker *c, Entity *pg_entity, DeclInfo *d) { } } - pg_entity->type = t_invalid; } void check_entity_decl(Checker *c, Entity *e, DeclInfo *d, Type *named_type) { |