فهرست منبع

Fix type_info usage

gingerBill 1 سال پیش
والد
کامیت
e66d71e9cf
3فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 0 1
      src/checker.cpp
  2. 1 1
      src/tilde_const.cpp
  3. 2 2
      src/tilde_type_info.cpp

+ 0 - 1
src/checker.cpp

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

+ 1 - 1
src/tilde_const.cpp

@@ -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) {

+ 2 - 2
src/tilde_type_info.cpp

@@ -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) {