aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-06-11 13:48:53 -0400
committerAndrew Kelley <andrew@ziglang.org>2019-06-11 13:48:53 -0400
commit515092210fe9d9f55c146bdea78289273b97bc0b (patch)
treec5f6c0248532ae21b7e6a516b4f585efaab93f8f /src
parent1c2e889820e50e26654990750ac5ef0755996618 (diff)
downloadzig-515092210fe9d9f55c146bdea78289273b97bc0b.tar.gz
zig-515092210fe9d9f55c146bdea78289273b97bc0b.zip
fix not checking return value of resolving result
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 0b9956253e..c57153d68c 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -14946,6 +14946,8 @@ static IrInstruction *ir_analyze_instruction_resolve_result(IrAnalyze *ira, IrIn
return ira->codegen->invalid_instruction;
IrInstruction *result_loc = ir_resolve_result(ira, &instruction->base, instruction->result_loc,
implicit_elem_type, nullptr);
+ if (instr_is_unreachable(result_loc) || type_is_invalid(result_loc->value.type))
+ return result_loc;
ir_assert(result_loc->value.type->id == ZigTypeIdPointer, &instruction->base);
ZigType *actual_elem_type = result_loc->value.type->data.pointer.child_type;
if (actual_elem_type->id == ZigTypeIdOptional && implicit_elem_type->id != ZigTypeIdOptional) {