aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-09-18 15:10:29 +0100
committergingerBill <bill@gingerbill.org>2021-09-18 15:10:29 +0100
commit71f2289c20c55ced92225fea97df66b1e53f3c37 (patch)
tree978d666b054b9d7b616ccb302e3034829dce1a5e /src/types.cpp
parent05ac2002e0296c3acccca1d8cffaafb002e43120 (diff)
Fix #1174
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 7a5ea489b..568516007 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -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) {