aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-01-11 19:09:17 -0500
committerAndrew Kelley <superjoe30@gmail.com>2017-01-11 19:09:17 -0500
commit25a670d74e16463c7a8f91c3af91f44bf52a9e27 (patch)
tree976b0e279fe21ca7407356cdf804c5cbb49b52a2 /src/ir.cpp
parentde9ecaf96470c9d2b9f165608a57ba03c9c0f17c (diff)
downloadzig-25a670d74e16463c7a8f91c3af91f44bf52a9e27.tar.gz
zig-25a670d74e16463c7a8f91c3af91f44bf52a9e27.zip
pass more tests
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp6
1 files changed, 6 insertions, 0 deletions
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<ConstExprValue>(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) {