From 25a670d74e16463c7a8f91c3af91f44bf52a9e27 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 11 Jan 2017 19:09:17 -0500 Subject: pass more tests --- src/ir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index a7367472aa..c5d647cdca 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -8471,6 +8471,9 @@ static TypeTableEntry *ir_analyze_decl_ref(IrAnalyze *ira, IrInstruction *source FnTableEntry *fn_entry = tld_fn->fn_entry; assert(fn_entry->type_entry); + if (fn_entry->type_entry->id == TypeTableEntryIdInvalid) + return ira->codegen->builtin_types.entry_invalid; + // TODO instead of allocating this every time, put it in the tld value and we can reference // the same one every time ConstExprValue *const_val = allocate(1); @@ -8568,6 +8571,9 @@ static TypeTableEntry *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstru } else if (is_container(child_type)) { if (child_type->id == TypeTableEntryIdEnum) { ensure_complete_type(ira->codegen, child_type); + if (child_type->data.enumeration.is_invalid) + return ira->codegen->builtin_types.entry_invalid; + TypeEnumField *field = find_enum_type_field(child_type, field_name); if (field) { if (field->type_entry->id == TypeTableEntryIdVoid) { -- cgit v1.2.3