This commit is contained in:
gingerBill
2021-09-18 15:10:29 +01:00
parent 05ac2002e0
commit 71f2289c20
6 changed files with 24 additions and 10 deletions
+2
View File
@@ -3325,11 +3325,13 @@ i64 type_offset_of(Type *t, i32 index) {
if (t->kind == Type_Struct) {
type_set_offsets(t);
if (gb_is_between(index, 0, t->Struct.fields.count-1)) {
GB_ASSERT(t->Struct.offsets != nullptr);
return t->Struct.offsets[index];
}
} else if (t->kind == Type_Tuple) {
type_set_offsets(t);
if (gb_is_between(index, 0, t->Tuple.variables.count-1)) {
GB_ASSERT(t->Tuple.offsets != nullptr);
return t->Tuple.offsets[index];
}
} else if (t->kind == Type_Basic) {