diff options
| author | emekoi <emekankurumeh@outlook.com> | 2019-02-12 10:21:45 -0600 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-02-15 20:02:09 -0500 |
| commit | 5736a9c6a9b357ab346dd8fcbe64f5d729d6d244 (patch) | |
| tree | 35108a2faf187ec1b4332340b8715a8666e2f238 /src/analyze.cpp | |
| parent | a05e224150a5a4bcad5ab1b399b43db8a0e28104 (diff) | |
| download | zig-5736a9c6a9b357ab346dd8fcbe64f5d729d6d244.tar.gz zig-5736a9c6a9b357ab346dd8fcbe64f5d729d6d244.zip | |
removed hidden union tag in release modes
Diffstat (limited to 'src/analyze.cpp')
| -rw-r--r-- | src/analyze.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp index 12e245bd72..9941104bc4 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -2886,7 +2886,7 @@ static Error resolve_union_zero_bits(CodeGen *g, ZigType *union_type) { union_type->data.unionation.have_explicit_tag_type = decl_node->data.container_decl.auto_enum || enum_type_node != nullptr; bool auto_layout = (union_type->data.unionation.layout == ContainerLayoutAuto); - bool want_safety = (field_count >= 2) && (auto_layout || enum_type_node != nullptr); + bool want_safety = (field_count >= 2) && (auto_layout || enum_type_node != nullptr) && !(g->build_mode == BuildModeFastRelease || g->build_mode == BuildModeSmallRelease); ZigType *tag_type; bool create_enum_type = decl_node->data.container_decl.auto_enum || (enum_type_node == nullptr && want_safety); bool *covered_enum_fields; |
