diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-06-09 00:00:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-09 00:00:24 +0200 |
| commit | 7813e9fb378753bf110f0ad4b5cc85e7f16336d4 (patch) | |
| tree | e9e352e36435842a016cfb3d559fa9df3f6611c6 /src/checker.cpp | |
| parent | d2d187eaaa4fecd33bf654dcd9013ca2ddbdef5b (diff) | |
| parent | 0747032e4a836a4295538d2c4945f2610ad2e615 (diff) | |
Merge pull request #5300 from Feoramund/fix-5299
Guard against untyped `nil` in type cycle and type info sections
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index ff7194835..67dee9963 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -6672,7 +6672,7 @@ gb_internal void check_sort_init_and_fini_procedures(Checker *c) { gb_internal void add_type_info_for_type_definitions(Checker *c) { for_array(i, c->info.definitions) { Entity *e = c->info.definitions[i]; - if (e->kind == Entity_TypeName && e->type != nullptr) { + if (e->kind == Entity_TypeName && e->type != nullptr && is_type_typed(e->type)) { i64 align = type_align_of(e->type); if (align > 0 && ptr_set_exists(&c->info.minimum_dependency_set, e)) { add_type_info_type(&c->builtin_ctx, e->type); @@ -6794,7 +6794,7 @@ gb_internal void check_parsed_files(Checker *c) { // NOTE(bill): Check for illegal cyclic type declarations for_array(i, c->info.definitions) { Entity *e = c->info.definitions[i]; - if (e->kind == Entity_TypeName && e->type != nullptr) { + if (e->kind == Entity_TypeName && e->type != nullptr && is_type_typed(e->type)) { (void)type_align_of(e->type); } else if (e->kind == Entity_Procedure) { DeclInfo *decl = e->decl_info; |