From 6907951f1eebcc9053ccfbe32a30dc704e790747 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Thu, 22 Sep 2016 13:34:14 +0100 Subject: Fix type info generation The problem: entry's index != entry->value in info_type_map But I was assuming this --- src/checker/type.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/checker/type.cpp') diff --git a/src/checker/type.cpp b/src/checker/type.cpp index ae415b3d5..085e7c61e 100644 --- a/src/checker/type.cpp +++ b/src/checker/type.cpp @@ -1062,7 +1062,8 @@ i64 type_size_of(BaseTypeSizes s, gbAllocator allocator, Type *t) { if (max < size) max = size; } - return align_formula(max, s.max_align) + type_size_of(s, allocator, t_int); + // NOTE(bill): Align to int + return align_formula(max, s.word_size) + type_size_of(s, allocator, t_int); } break; case TypeRecord_RawUnion: { -- cgit v1.2.3