aboutsummaryrefslogtreecommitdiff
path: root/src/llvm_backend_const.cpp
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-05-22 16:04:42 +0100
committerGitHub <noreply@github.com>2025-05-22 16:04:42 +0100
commitc383e550f9da373631bea702c4614f62eb7ad804 (patch)
treeadd4106cbde3d52df97cef761622a0719ded61a6 /src/llvm_backend_const.cpp
parentea65a7b870736311747c517970df3921d227e024 (diff)
parent93d2e6aca2c771477b133af0decfefa3eb607ab9 (diff)
Merge branch 'master' into bill/raddebugger-custom-section
Diffstat (limited to 'src/llvm_backend_const.cpp')
-rw-r--r--src/llvm_backend_const.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/llvm_backend_const.cpp b/src/llvm_backend_const.cpp
index dada2cff5..51c8a4449 100644
--- a/src/llvm_backend_const.cpp
+++ b/src/llvm_backend_const.cpp
@@ -533,7 +533,10 @@ gb_internal lbValue lb_const_value(lbModule *m, Type *type, ExactValue value, lb
Entity *e = entity_from_expr(expr);
res = lb_find_procedure_value_from_entity(m, e);
}
- GB_ASSERT(res.value != nullptr);
+ if (res.value == nullptr) {
+ // This is an unspecialized polymorphic procedure, return nil or dummy value
+ return lb_const_nil(m, original_type);
+ }
GB_ASSERT(LLVMGetValueKind(res.value) == LLVMFunctionValueKind);
if (LLVMGetIntrinsicID(res.value) == 0) {