aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-26 14:00:44 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-06-26 14:00:44 -0400
commit33f996bb163568c9bb10e5044ed9df53599a917f (patch)
treec4e095935269530567e18442526e01de9aab2e73 /src/ir.cpp
parent32c6f643aef6a5cad8942c54689210d35b48245a (diff)
downloadzig-33f996bb163568c9bb10e5044ed9df53599a917f.tar.gz
zig-33f996bb163568c9bb10e5044ed9df53599a917f.zip
all tests passing on linux
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 794d41ce22..480493d2ce 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -10726,6 +10726,8 @@ static ZigType *ir_resolve_peer_types(IrAnalyze *ira, AstNode *source_node, ZigT
} else if (prev_inst->value.type->id == ZigTypeIdOptional) {
return prev_inst->value.type;
} else {
+ if ((err = type_resolve(ira->codegen, prev_inst->value.type, ResolveStatusSizeKnown)))
+ return ira->codegen->builtin_types.entry_invalid;
return get_optional_type(ira->codegen, prev_inst->value.type);
}
} else {
@@ -21547,7 +21549,7 @@ static IrInstruction *ir_analyze_instruction_from_bytes(IrAnalyze *ira, IrInstru
IrInstruction *result_loc = ir_resolve_result(ira, &instruction->base, instruction->result_loc,
dest_slice_type, nullptr, true, false);
- if (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc)) {
+ if (result_loc != nullptr && (type_is_invalid(result_loc->value.type) || instr_is_unreachable(result_loc))) {
return result_loc;
}