From c4ee37f5067e7dd2c017df1fd6c57c1fad92cf85 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sat, 18 Feb 2017 18:33:21 -0500 Subject: fix assertion failure when first use of a struct is sizeOf --- src/analyze.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index e4ccf699ba..30f4d44cac 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -253,6 +253,7 @@ bool type_has_zero_bits_known(TypeTableEntry *type_entry) { uint64_t type_size(CodeGen *g, TypeTableEntry *type_entry) { + assert(type_is_complete(type_entry)); if (type_has_bits(type_entry)) { return LLVMStoreSizeOfType(g->target_data_ref, type_entry->type_ref); } else { -- cgit v1.2.3