diff options
| author | gingerBill <bill@gingerbill.org> | 2019-12-22 14:16:56 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-12-22 14:16:56 +0000 |
| commit | 1d14b3059e0e4310ffc061ca606d2eb6a153149d (patch) | |
| tree | 237d6f97cbd33f5888d78399005fc2ee637b0b80 /src/checker.cpp | |
| parent | cc2fa8f7564b937601f87bd2611f7ddb88594043 (diff) | |
Fix Internal Compiler Error: Type_Info for 'XXX' could not be found #507
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 675857cf4..ec6e5d4d0 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1435,7 +1435,12 @@ void add_min_dep_type_info(Checker *c, Type *t) { auto *set = &c->info.minimum_dependency_type_info_set; - isize ti_index = type_info_index(&c->info, t); + isize ti_index = type_info_index(&c->info, t, false); + if (ti_index < 0) { + add_type_info_type(&c->init_ctx, t); // Missing the type information + ti_index = type_info_index(&c->info, t, false); + } + GB_ASSERT(ti_index >= 0); if (ptr_set_exists(set, ti_index)) { // Type Already exists return; @@ -1528,16 +1533,16 @@ void add_min_dep_type_info(Checker *c, Type *t) { break; case Type_Struct: + for_array(i, bt->Struct.fields) { + Entity *f = bt->Struct.fields[i]; + add_min_dep_type_info(c, f->type); + } if (bt->Struct.scope != nullptr) { for_array(i, bt->Struct.scope->elements.entries) { Entity *e = bt->Struct.scope->elements.entries[i].value; add_min_dep_type_info(c, e->type); } } - for_array(i, bt->Struct.fields) { - Entity *f = bt->Struct.fields[i]; - add_min_dep_type_info(c, f->type); - } break; case Type_BitFieldValue: |