mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-20 12:44:59 -07:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user