diff --git a/src/codegen.cpp b/src/codegen.cpp index 95b55675b..a04815bfc 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -4022,7 +4022,8 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr bool callee_is_async; if (instruction->fn_entry) { fn_val = fn_llvm_value(g, instruction->fn_entry); - fn_type = instruction->fn_entry->type_entry; + fn_type = instruction->fn_ref ? + instruction->fn_ref->value->type : instruction->fn_entry->type_entry; callee_is_async = fn_is_async(instruction->fn_entry); } else { assert(instruction->fn_ref); diff --git a/src/ir.cpp b/src/ir.cpp index d871aa27a..ffc6aa24c 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -18848,7 +18848,7 @@ static IrInstruction *ir_analyze_instruction_call(IrAnalyze *ira, IrInstructionC return ira->codegen->invalid_instruction; } else if (fn_ref->value->type->id == ZigTypeIdFn) { ZigFn *fn_table_entry = ir_resolve_fn(ira, fn_ref); - ZigType *fn_type = fn_table_entry ? fn_table_entry->type_entry : fn_ref->value->type; + ZigType *fn_type = fn_ref->value->type; CallModifier modifier = is_comptime ? CallModifierCompileTime : call_instruction->modifier; return ir_analyze_fn_call_src(ira, call_instruction, fn_table_entry, fn_type, fn_ref, nullptr, modifier);