aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-02-18 18:33:21 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-02-18 18:33:21 -0500
commitc4ee37f5067e7dd2c017df1fd6c57c1fad92cf85 (patch)
tree296bbdc9529662abe24ae39ac1800399a64b488b /src/ir.cpp
parent0148f39df929cc00c1b2231acce41c22f74f9969 (diff)
downloadzig-c4ee37f5067e7dd2c017df1fd6c57c1fad92cf85.tar.gz
zig-c4ee37f5067e7dd2c017df1fd6c57c1fad92cf85.zip
fix assertion failure when first use of a struct is sizeOf
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index d71079d77f..908499779d 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -9904,6 +9904,9 @@ static TypeTableEntry *ir_analyze_instruction_size_of(IrAnalyze *ira,
IrInstruction *type_value = size_of_instruction->type_value->other;
TypeTableEntry *type_entry = ir_resolve_type(ira, type_value);
TypeTableEntry *canon_type_entry = get_underlying_type(type_entry);
+
+ ensure_complete_type(ira->codegen, type_entry);
+
switch (canon_type_entry->id) {
case TypeTableEntryIdInvalid:
return ira->codegen->builtin_types.entry_invalid;