| ... | @@ -18497,6 +18497,12 @@ static TypeTableEntry *ir_analyze_instruction_float_to_int(IrAnalyze *ira, IrIns | ... | @@ -18497,6 +18497,12 @@ static TypeTableEntry *ir_analyze_instruction_float_to_int(IrAnalyze *ira, IrIns |
| 18497 | if (type_is_invalid(target->value.type)) | 18497 | if (type_is_invalid(target->value.type)) |
| 18498 | return ira->codegen->builtin_types.entry_invalid; | 18498 | return ira->codegen->builtin_types.entry_invalid; |
| 18499 | | 18499 | |
| | 18500 | if (target->value.type->id != TypeTableEntryIdFloat && target->value.type->id != TypeTableEntryIdComptimeFloat) { |
| | 18501 | ir_add_error(ira, instruction->target, buf_sprintf("expected float type, found '%s'", |
| | 18502 | buf_ptr(&target->value.type->name))); |
| | 18503 | return ira->codegen->builtin_types.entry_invalid; |
| | 18504 | } |
| | 18505 | |
| 18500 | IrInstruction *result = ir_resolve_cast(ira, &instruction->base, target, dest_type, CastOpFloatToInt, false); | 18506 | IrInstruction *result = ir_resolve_cast(ira, &instruction->base, target, dest_type, CastOpFloatToInt, false); |
| 18501 | ir_link_new_instruction(result, &instruction->base); | 18507 | ir_link_new_instruction(result, &instruction->base); |
| 18502 | return dest_type; | 18508 | return dest_type; |