Skip to content

Commit 5736a9c

Browse files
emekoiandrewrk
authored andcommitted
removed hidden union tag in release modes
1 parent a05e224 commit 5736a9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/analyze.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2886,7 +2886,7 @@ static Error resolve_union_zero_bits(CodeGen *g, ZigType *union_type) {
28862886
union_type->data.unionation.have_explicit_tag_type = decl_node->data.container_decl.auto_enum ||
28872887
enum_type_node != nullptr;
28882888
bool auto_layout = (union_type->data.unionation.layout == ContainerLayoutAuto);
2889-
bool want_safety = (field_count >= 2) && (auto_layout || enum_type_node != nullptr);
2889+
bool want_safety = (field_count >= 2) && (auto_layout || enum_type_node != nullptr) && !(g->build_mode == BuildModeFastRelease || g->build_mode == BuildModeSmallRelease);
28902890
ZigType *tag_type;
28912891
bool create_enum_type = decl_node->data.container_decl.auto_enum || (enum_type_node == nullptr && want_safety);
28922892
bool *covered_enum_fields;

0 commit comments

Comments
 (0)