diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-05-09 08:35:16 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-09 08:35:16 +0100 |
| commit | 23aff08556589a80d886cceb3482428507e7c46f (patch) | |
| tree | 9ee38691a31346fdc534976cca8cbfea259a5045 /src/llvm_backend_const.cpp | |
| parent | 10d83323949a11364c77c6a6c32196990509870b (diff) | |
| parent | 3c0ba5bb55fe59ed1644c3e61fd2a81fb856624e (diff) | |
Merge pull request #5117 from bogwi/bug/5024
Bug/5024
Diffstat (limited to 'src/llvm_backend_const.cpp')
| -rw-r--r-- | src/llvm_backend_const.cpp | 5 |
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) { |