aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2019-09-12 23:02:15 +0200
committerAndrew Kelley <andrew@ziglang.org>2019-09-24 00:31:35 -0400
commit93367adaa770944a13a8d44628dfefe1abe91906 (patch)
tree993dfd70ae5290809b635ba9ee42cae6c949e8fa /src
parent0bdc85181cbe1954dac7e96c5ab4b2fe209b9098 (diff)
downloadzig-93367adaa770944a13a8d44628dfefe1abe91906.tar.gz
zig-93367adaa770944a13a8d44628dfefe1abe91906.zip
Fix assignment to optional payload
Closes #3081
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 16e37d61ac..4e6752a0fa 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -15487,6 +15487,7 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, IrInstruction *suspend_s
if (actual_elem_type->id == ZigTypeIdOptional && value_type->id != ZigTypeIdOptional &&
value_type->id != ZigTypeIdNull)
{
+ result_loc_pass1->written = false;
return ir_analyze_unwrap_optional_payload(ira, suspend_source_instr, result_loc, false, true);
} else if (actual_elem_type->id == ZigTypeIdErrorUnion && value_type->id != ZigTypeIdErrorUnion) {
if (value_type->id == ZigTypeIdErrorSet) {