diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-07-25 13:12:03 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-07-25 13:12:03 -0400 |
| commit | 2257660916a8c92d953a5a71da6c2d4f7cc031e6 (patch) | |
| tree | 251e9ac556ff808733cfbb8b8afedcb3ba68a710 /src/ir.cpp | |
| parent | 95f45cfc34cd5e77dad2318cab27194535e14d16 (diff) | |
| download | zig-2257660916a8c92d953a5a71da6c2d4f7cc031e6.tar.gz zig-2257660916a8c92d953a5a71da6c2d4f7cc031e6.zip | |
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
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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, |
