From 71f2289c20c55ced92225fea97df66b1e53f3c37 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 18 Sep 2021 15:10:29 +0100 Subject: Fix #1174 --- src/types.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/types.cpp') 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) { -- cgit v1.2.3