aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-12-18 00:25:07 -0500
committerAndrew Kelley <superjoe30@gmail.com>2016-12-18 00:25:07 -0500
commit83a668b9caac7a9ae7ed2b2e9bf87f34ec2ab1eb (patch)
tree17220de13f64782c039d9bf56fdaff8376d6f33b /src/ir.cpp
parent9f08bfb38ddbe4b066953d68f2f10e9d83ad4e74 (diff)
downloadzig-83a668b9caac7a9ae7ed2b2e9bf87f34ec2ab1eb.tar.gz
zig-83a668b9caac7a9ae7ed2b2e9bf87f34ec2ab1eb.zip
IR: unreachable has lowest priority when resolving peer types
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index b26b896949..7211b4e614 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -4248,6 +4248,10 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
TypeTableEntry *prev_type = prev_inst->type_entry;
if (cur_type->id == TypeTableEntryIdInvalid) {
return cur_type;
+ } else if (prev_type->id == TypeTableEntryIdUnreachable) {
+ prev_inst = cur_inst;
+ } else if (cur_type->id == TypeTableEntryIdUnreachable) {
+ continue;
} else if (prev_type->id == TypeTableEntryIdPureError) {
prev_inst = cur_inst;
continue;
@@ -4265,10 +4269,6 @@ static TypeTableEntry *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_nod
} else if (types_match_const_cast_only(cur_type, prev_type)) {
prev_inst = cur_inst;
continue;
- } else if (prev_type->id == TypeTableEntryIdUnreachable) {
- prev_inst = cur_inst;
- } else if (cur_type->id == TypeTableEntryIdUnreachable) {
- continue;
} else if (prev_type->id == TypeTableEntryIdInt &&
cur_type->id == TypeTableEntryIdInt &&
prev_type->data.integral.is_signed == cur_type->data.integral.is_signed)