aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2024-06-28 08:53:05 +0100
committergingerBill <bill@gingerbill.org>2024-06-28 08:53:05 +0100
commit06ff08b9cf50760d17cd49bee0670fa27782aff5 (patch)
tree2ac529d4f4e6c42207cbdff1157ada3ad2909a60
parent52ea63f89c7d7c9ff081ab678f9c206e9775a032 (diff)
Fix #3820
-rw-r--r--src/llvm_backend_expr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/llvm_backend_expr.cpp b/src/llvm_backend_expr.cpp
index a23f8cfbe..52dad6547 100644
--- a/src/llvm_backend_expr.cpp
+++ b/src/llvm_backend_expr.cpp
@@ -3283,7 +3283,8 @@ gb_internal lbValue lb_build_expr_internal(lbProcedure *p, Ast *expr) {
Type *type = type_of_expr(expr);
GB_ASSERT_MSG(tv.mode != Addressing_Invalid, "invalid expression '%s' (tv.mode = %d, tv.type = %s) @ %s\n Current Proc: %.*s : %s", expr_to_string(expr), tv.mode, type_to_string(tv.type), token_pos_to_string(expr_pos), LIT(p->name), type_to_string(p->type));
- if (tv.value.kind != ExactValue_Invalid) {
+
+ if (tv.value.kind != ExactValue_Invalid && !is_type_union(type)) {
// NOTE(bill): The commented out code below is just for debug purposes only
// if (is_type_untyped(type)) {
// gb_printf_err("%s %s : %s @ %p\n", token_pos_to_string(expr_pos), expr_to_string(expr), type_to_string(expr->tav.type), expr);