aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorxackus <14938807+xackus@users.noreply.github.com>2020-05-31 15:04:34 +0200
committerxackus <14938807+xackus@users.noreply.github.com>2020-05-31 15:04:34 +0200
commit250dd9ac21ffcd2fe1dba6d0cdebcbb683c199a9 (patch)
tree6e292cd3512cc0f0f79b5b9b1e78aa31d0a74a76 /src/ir.cpp
parent557d75d58a787ed0154e9bb2e58d26f9a5f9414e (diff)
downloadzig-250dd9ac21ffcd2fe1dba6d0cdebcbb683c199a9.tar.gz
zig-250dd9ac21ffcd2fe1dba6d0cdebcbb683c199a9.zip
stage1: fix unresolved inferred error sets
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index a263e7c24d..54442861ca 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -18177,12 +18177,6 @@ static IrInstGen *ir_analyze_instruction_merge_err_sets(IrAnalyze *ira,
if (type_is_invalid(op2_type))
return ira->codegen->invalid_inst_gen;
- if (type_is_global_error_set(op1_type) ||
- type_is_global_error_set(op2_type))
- {
- return ir_const_type(ira, &instruction->base.base, ira->codegen->builtin_types.entry_global_error_set);
- }
-
if (!resolve_inferred_error_set(ira->codegen, op1_type, instruction->op1->child->base.source_node)) {
return ira->codegen->invalid_inst_gen;
}
@@ -18191,6 +18185,12 @@ static IrInstGen *ir_analyze_instruction_merge_err_sets(IrAnalyze *ira,
return ira->codegen->invalid_inst_gen;
}
+ if (type_is_global_error_set(op1_type) ||
+ type_is_global_error_set(op2_type))
+ {
+ return ir_const_type(ira, &instruction->base.base, ira->codegen->builtin_types.entry_global_error_set);
+ }
+
size_t errors_count = ira->codegen->errors_by_index.length;
ErrorTableEntry **errors = heap::c_allocator.allocate<ErrorTableEntry *>(errors_count);
for (uint32_t i = 0, count = op1_type->data.error_set.err_count; i < count; i += 1) {