aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_general.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2023-06-26 17:36:27 +0100
committergingerBill <bill@gingerbill.org>2023-06-26 17:36:27 +0100
commit8b8310711e4924678e605278fca1f8dbf517b903 (patch)
tree7e242ed95488b534f99c61d8d8084b60e29347cc /src/llvm_backend_general.cpp
parentcdcb64b0d08be85c3ea579270eeb4d193b4cb495 (diff)
Fix #2594 zero sized union code generation
Diffstat (limited to 'src/llvm_backend_general.cpp')
-rw-r--r--src/llvm_backend_general.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/llvm_backend_general.cpp b/src/llvm_backend_general.cpp
index 9333f13a4..017eeca2e 100644
--- a/src/llvm_backend_general.cpp
+++ b/src/llvm_backend_general.cpp
@@ -1323,6 +1323,7 @@ gb_internal lbValue lb_emit_union_tag_value(lbProcedure *p, lbValue u) {
gb_internal void lb_emit_store_union_variant_tag(lbProcedure *p, lbValue parent, Type *variant_type) {
Type *t = type_deref(parent.type);
+ GB_ASSERT(is_type_union(t));
if (is_type_union_maybe_pointer(t) || type_size_of(t) == 0) {
// No tag needed!