| ... | @@ -11297,7 +11297,10 @@ static ZigFn *ir_resolve_fn(IrAnalyze *ira, IrInstruction *fn_value) { | ... | @@ -11297,7 +11297,10 @@ static ZigFn *ir_resolve_fn(IrAnalyze *ira, IrInstruction *fn_value) { |
| 11297 | if (!const_val) | 11297 | if (!const_val) |
| 11298 | return nullptr; | 11298 | return nullptr; |
| 11299 | | 11299 | |
| 11300 | assert(const_val->data.x_ptr.special == ConstPtrSpecialFunction); | 11300 | // May be a ConstPtrSpecialHardCodedAddr |
| | 11301 | if (const_val->data.x_ptr.special != ConstPtrSpecialFunction) |
| | 11302 | return nullptr; |
| | 11303 | |
| 11301 | return const_val->data.x_ptr.data.fn.fn_entry; | 11304 | return const_val->data.x_ptr.data.fn.fn_entry; |
| 11302 | } | 11305 | } |
| 11303 | | 11306 | |
| ... | @@ -16737,9 +16740,8 @@ static IrInstruction *ir_analyze_instruction_call(IrAnalyze *ira, IrInstructionC | ... | @@ -16737,9 +16740,8 @@ static IrInstruction *ir_analyze_instruction_call(IrAnalyze *ira, IrInstructionC |
| 16737 | return ir_finish_anal(ira, cast_instruction); | 16740 | return ir_finish_anal(ira, cast_instruction); |
| 16738 | } else if (fn_ref->value.type->id == ZigTypeIdFn) { | 16741 | } else if (fn_ref->value.type->id == ZigTypeIdFn) { |
| 16739 | ZigFn *fn_table_entry = ir_resolve_fn(ira, fn_ref); | 16742 | ZigFn *fn_table_entry = ir_resolve_fn(ira, fn_ref); |
| 16740 | if (fn_table_entry == nullptr) | 16743 | ZigType *fn_type = fn_table_entry ? fn_table_entry->type_entry : fn_ref->value.type; |
| 16741 | return ira->codegen->invalid_instruction; | 16744 | return ir_analyze_fn_call(ira, call_instruction, fn_table_entry, fn_type, |
| 16742 | return ir_analyze_fn_call(ira, call_instruction, fn_table_entry, fn_table_entry->type_entry, | | |
| 16743 | fn_ref, nullptr, is_comptime, call_instruction->fn_inline); | 16745 | fn_ref, nullptr, is_comptime, call_instruction->fn_inline); |
| 16744 | } else if (fn_ref->value.type->id == ZigTypeIdBoundFn) { | 16746 | } else if (fn_ref->value.type->id == ZigTypeIdBoundFn) { |
| 16745 | assert(fn_ref->value.special == ConstValSpecialStatic); | 16747 | assert(fn_ref->value.special == ConstValSpecialStatic); |
| ... | @@ -16756,7 +16758,7 @@ static IrInstruction *ir_analyze_instruction_call(IrAnalyze *ira, IrInstructionC | ... | @@ -16756,7 +16758,7 @@ static IrInstruction *ir_analyze_instruction_call(IrAnalyze *ira, IrInstructionC |
| 16756 | | 16758 | |
| 16757 | if (fn_ref->value.type->id == ZigTypeIdFn) { | 16759 | if (fn_ref->value.type->id == ZigTypeIdFn) { |
| 16758 | return ir_analyze_fn_call(ira, call_instruction, nullptr, fn_ref->value.type, | 16760 | return ir_analyze_fn_call(ira, call_instruction, nullptr, fn_ref->value.type, |
| 16759 | fn_ref, nullptr, false, FnInlineAuto); | 16761 | fn_ref, nullptr, false, call_instruction->fn_inline); |
| 16760 | } else { | 16762 | } else { |
| 16761 | ir_add_error_node(ira, fn_ref->source_node, | 16763 | ir_add_error_node(ira, fn_ref->source_node, |
| 16762 | buf_sprintf("type '%s' not a function", buf_ptr(&fn_ref->value.type->name))); | 16764 | buf_sprintf("type '%s' not a function", buf_ptr(&fn_ref->value.type->name))); |