aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-11-04 20:56:49 +0000
committerGitHub <noreply@github.com>2025-11-04 20:56:49 +0000
commit12d8572d439d40d030b12e8fc98210ed255405d7 (patch)
treebdcdac4db3ca857ed5515492c348617ff4d3d536 /src/types.cpp
parentf70454c237a74b8ead76bf1cd6d3fb94e30d2e8a (diff)
parent3ef063632498a59bd6df3de5d34e92bf6b6102d8 (diff)
Merge pull request #5886 from laytan/32bit-typeid-fixes
fixes for 32bit with regards to typeid
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/types.cpp b/src/types.cpp
index a1311ba5d..b9089b9fc 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -4577,6 +4577,8 @@ gb_internal i64 type_offset_of(Type *t, i64 index, Type **field_type_) {
case 1:
if (field_type_) *field_type_ = t_typeid;
return 8; // id
+ default:
+ GB_PANIC("index > 1");
}
}
break;
@@ -4654,6 +4656,7 @@ gb_internal i64 type_offset_of_from_selection(Type *type, Selection sel) {
switch (index) {
case 0: t = t_rawptr; break;
case 1: t = t_typeid; break;
+ default: GB_PANIC("index > 1");
}
}
break;
@@ -4919,7 +4922,7 @@ gb_internal Type *type_internal_index(Type *t, isize index) {
case Type_Slice:
{
GB_ASSERT(index == 0 || index == 1);
- return index == 0 ? t_rawptr : t_typeid;
+ return index == 0 ? t_rawptr : t_int;
}
case Type_DynamicArray:
{