Skip to content

Commit 2257660

Browse files
committedJul 25, 2018
fix assertion failure when some compile errors happen
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
·
0.15.10.3.0
1 parent 95f45cf commit 2257660

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/ir.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18991,6 +18991,9 @@ static TypeTableEntry *ir_analyze_instruction_unwrap_err_payload(IrAnalyze *ira,
1899118991
return ira->codegen->builtin_types.entry_invalid;
1899218992
} else if (type_entry->id == TypeTableEntryIdErrorUnion) {
1899318993
TypeTableEntry *payload_type = type_entry->data.error_union.payload_type;
18994+
if (type_is_invalid(payload_type)) {
18995+
return ira->codegen->builtin_types.entry_invalid;
18996+
}
1899418997
TypeTableEntry *result_type = get_pointer_to_type_extra(ira->codegen, payload_type,
1899518998
ptr_type->data.pointer.is_const, ptr_type->data.pointer.is_volatile,
1899618999
PtrLenSingle,

0 commit comments

Comments
 (0)
Please sign in to comment.