diff options
| author | LemonBoy <thatlemon@gmail.com> | 2019-09-12 23:02:15 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-09-24 00:31:35 -0400 |
| commit | 93367adaa770944a13a8d44628dfefe1abe91906 (patch) | |
| tree | 993dfd70ae5290809b635ba9ee42cae6c949e8fa /src/ir.cpp | |
| parent | 0bdc85181cbe1954dac7e96c5ab4b2fe209b9098 (diff) | |
| download | zig-93367adaa770944a13a8d44628dfefe1abe91906.tar.gz zig-93367adaa770944a13a8d44628dfefe1abe91906.zip | |
Fix assignment to optional payload
Closes #3081
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 1 |
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) { |
