From 6cbb732b59d1ded92c7272a8b06f645e1c8acfd2 Mon Sep 17 00:00:00 2001 From: LemonBoy Date: Thu, 10 Oct 2019 10:47:59 +0200 Subject: Extern unions should not trigger active field check Fixes #3378 --- src/ir.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 8fecbf7a18..7dd141423c 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -17951,7 +17951,7 @@ static IrInstruction *ir_analyze_container_field_ptr(IrAnalyze *ira, Buf *field_ union_val->special = ConstValSpecialStatic; bigint_init_bigint(&union_val->data.x_union.tag, &field->enum_field->value); union_val->data.x_union.payload = payload_val; - } else { + } else if (bare_type->data.unionation.layout != ContainerLayoutExtern) { TypeUnionField *actual_field = find_union_field_by_tag(bare_type, &union_val->data.x_union.tag); if (actual_field == nullptr) zig_unreachable(); -- cgit v1.2.3