From 2257660916a8c92d953a5a71da6c2d4f7cc031e6 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 25 Jul 2018 13:12:03 -0400 Subject: [PATCH] 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 --- src/ir.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ir.cpp b/src/ir.cpp index fe5fb77085..fd2558c5eb 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -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,