Fix type_info usage

This commit is contained in:
gingerBill
2024-06-11 13:10:26 +01:00
parent a8ec2c06f3
commit e66d71e9cf
3 changed files with 3 additions and 4 deletions

View File

@@ -2204,7 +2204,6 @@ gb_internal void check_procedure_later(Checker *c, AstFile *file, Token token, D
check_procedure_later(c, info);
}
gb_internal void add_min_dep_type_info(Checker *c, Type *t) {
if (t == nullptr) {
return;

View File

@@ -950,7 +950,7 @@ gb_internal cgValue cg_const_value(cgProcedure *p, Type *type, ExactValue const
case ExactValue_Integer:
GB_ASSERT(!TB_IS_VOID_TYPE(dt));
// GB_ASSERT(dt.raw != TB_TYPE_I128.raw);
GB_ASSERT(dt.raw != TB_TYPE_I128.raw);
if (is_type_unsigned(type)) {
u64 i = 0;
if (value.kind == ExactValue_Integer && value.value_integer.sign) {

View File

@@ -23,10 +23,10 @@ gb_internal isize cg_type_info_index(CheckerInfo *info, Type *type, bool err_on_
auto *set = &info->minimum_dependency_type_info_set;
isize index = type_info_index(info, type, err_on_not_found);
if (index >= 0) {
auto *found = map_get(set, index);
auto *found = map_get(set, index+1);
if (found) {
GB_ASSERT(*found >= 0);
return *found + 1;
return *found;
}
}
if (err_on_not_found) {