fix assertion failed when invalid type encountered
parent
40480c7cdc
commit
cd36baf530
|
@ -338,7 +338,7 @@ TypeTableEntry *get_smallest_unsigned_int_type(CodeGen *g, uint64_t x) {
|
|||
TypeTableEntry *get_pointer_to_type_extra(CodeGen *g, TypeTableEntry *child_type, bool is_const,
|
||||
bool is_volatile, uint32_t byte_alignment, uint32_t bit_offset, uint32_t unaligned_bit_count)
|
||||
{
|
||||
assert(child_type->id != TypeTableEntryIdInvalid);
|
||||
assert(!type_is_invalid(child_type));
|
||||
|
||||
TypeId type_id = {};
|
||||
TypeTableEntry **parent_pointer = nullptr;
|
||||
|
|
|
@ -7966,6 +7966,9 @@ static IrInstruction *ir_get_const_ptr(IrAnalyze *ira, IrInstruction *instructio
|
|||
ConstExprValue *const_val = &const_instr->value;
|
||||
const_val->type = pointee_type;
|
||||
type_ensure_zero_bits_known(ira->codegen, type_entry);
|
||||
if (type_is_invalid(type_entry)) {
|
||||
return ira->codegen->invalid_instruction;
|
||||
}
|
||||
const_val->data.x_type = get_pointer_to_type_extra(ira->codegen, type_entry,
|
||||
ptr_is_const, ptr_is_volatile, get_abi_alignment(ira->codegen, type_entry), 0, 0);
|
||||
return const_instr;
|
||||
|
|
Loading…
Reference in New Issue