aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-11-02 13:22:06 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2025-11-02 13:22:06 +0100
commit283b1606973a543c54c0a91b47ffb7459d92c23e (patch)
tree72f796acda0721c6041eac628b445c71494a9677 /src
parent505b85ead546a093a94b157889fbfe83731a55c2 (diff)
parent7f2ab31acc411fa33438407fd41a3c2a1b3bc46a (diff)
Merge branch 'master' into bug-5865
Diffstat (limited to 'src')
-rw-r--r--src/llvm_backend_const.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp
index 952427dac..c014adc05 100644
--- a/src/llvm_backend_const.cpp
+++ b/src/llvm_backend_const.cpp
@@ -701,6 +701,10 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, lb
}
}
+ if (value_type == t_untyped_nil) {
+ return lb_const_nil(m, original_type);
+ }
+
Type *t = bt->Union.variants[0];
lbValue cv = lb_const_value(m, t, value, cc);
GB_ASSERT(LLVMIsConstant(cv.value));
@@ -741,6 +745,8 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, lb
} else if (value.kind == ExactValue_Invalid) {
return lb_const_nil(m, original_type);
}
+ } else if (value_type == t_untyped_nil) {
+ return lb_const_nil(m, original_type);
}
GB_ASSERT_MSG(value_type != nullptr, "%s :: %s", type_to_string(original_type), exact_value_to_string(value));