Skip to content

Commit

Permalink
fix assertion failure when some compile errors happen
Browse files Browse the repository at this point in the history
I don't actually know of a test case to trigger this

self-hosted won't have this problem because get_pointer_to_type
will return error.SemanticAnalysisFailed
  • Loading branch information
andrewrk committed Jul 25, 2018
1 parent 95f45cf commit 2257660
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ir.cpp
Expand Up @@ -18991,6 +18991,9 @@ static TypeTableEntry *ir_analyze_instruction_unwrap_err_payload(IrAnalyze *ira,
return ira->codegen->builtin_types.entry_invalid;
} else if (type_entry->id == TypeTableEntryIdErrorUnion) {
TypeTableEntry *payload_type = type_entry->data.error_union.payload_type;
if (type_is_invalid(payload_type)) {
return ira->codegen->builtin_types.entry_invalid;
}
TypeTableEntry *result_type = get_pointer_to_type_extra(ira->codegen, payload_type,
ptr_type->data.pointer.is_const, ptr_type->data.pointer.is_volatile,
PtrLenSingle,
Expand Down

0 comments on commit 2257660

Please sign in to comment.