CHECK 1 done

Fix panic in LLVM backend when using generic procedure with default arguments

- Fixed panic in `llvm_backend_proc.cpp` when using unspecialized polymorphic procedures as defaults.
- Ensured correct type inference when generic procedures are used as default parameters.
This commit is contained in:
bogwi
2025-05-05 14:18:11 +09:00
parent 93f80f60fb
commit ee8aeea381
3 changed files with 26 additions and 3 deletions
+4 -1
View File
@@ -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) {