From 93367adaa770944a13a8d44628dfefe1abe91906 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 12 Sep 2019 23:02:15 +0200 Subject: Fix assignment to optional payload Closes #3081 --- src/ir.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ir.cpp') 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) { -- cgit v1.2.3