fix assertion failure when first use of a struct is sizeOf
This commit is contained in:
parent
0148f39df9
commit
c4ee37f506
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user