| ... | @@ -9386,21 +9386,21 @@ static TypeTableEntry *ir_analyze_bin_op_math(IrAnalyze *ira, IrInstructionBinOp | ... | @@ -9386,21 +9386,21 @@ static TypeTableEntry *ir_analyze_bin_op_math(IrAnalyze *ira, IrInstructionBinOp |
| 9386 | if (is_signed_div) { | 9386 | if (is_signed_div) { |
| 9387 | bool ok = false; | 9387 | bool ok = false; |
| 9388 | if (instr_is_comptime(op1) && instr_is_comptime(op2)) { | 9388 | if (instr_is_comptime(op1) && instr_is_comptime(op2)) { |
| 9389 | 				if (bigint_cmp_zero(&op2->value.data.x_bigint) == CmpEQ) { | 9389 | if (bigint_cmp_zero(&op2->value.data.x_bigint) == CmpEQ) { |
| 9390 | // the division by zero error will be caught later, but we don't have a | 9390 | // the division by zero error will be caught later, but we don't have a |
| 9391 | // division function ambiguity problem. | 9391 | // division function ambiguity problem. |
| 9392 | op_id = IrBinOpDivTrunc; | 9392 | op_id = IrBinOpDivTrunc; |
| 9393 | 					ok = true; | 9393 | ok = true; |
| 9394 | 				} else { | 9394 | } else { |
| 9395 | 					BigInt trunc_result; | 9395 | BigInt trunc_result; |
| 9396 | 					BigInt floor_result; | 9396 | BigInt floor_result; |
| 9397 | 					bigint_div_trunc(&trunc_result, &op1->value.data.x_bigint, &op2->value.data.x_bigint); | 9397 | bigint_div_trunc(&trunc_result, &op1->value.data.x_bigint, &op2->value.data.x_bigint); |
| 9398 | 					bigint_div_floor(&floor_result, &op1->value.data.x_bigint, &op2->value.data.x_bigint); | 9398 | bigint_div_floor(&floor_result, &op1->value.data.x_bigint, &op2->value.data.x_bigint); |
| 9399 | 					if (bigint_cmp(&trunc_result, &floor_result) == CmpEQ) { | 9399 | if (bigint_cmp(&trunc_result, &floor_result) == CmpEQ) { |
| 9400 | 						ok = true; | 9400 | ok = true; |
| 9401 | 						op_id = IrBinOpDivTrunc; | 9401 | op_id = IrBinOpDivTrunc; |
| 9402 | 					} | 9402 | } |
| 9403 | 				} | 9403 | } |
| 9404 | } | 9404 | } |
| 9405 | if (!ok) { | 9405 | if (!ok) { |
| 9406 | ir_add_error(ira, &bin_op_instruction->base, | 9406 | ir_add_error(ira, &bin_op_instruction->base, |
| ... | @@ -9697,7 +9697,7 @@ static TypeTableEntry *ir_analyze_array_mult(IrAnalyze *ira, IrInstructionBinOp | ... | @@ -9697,7 +9697,7 @@ static TypeTableEntry *ir_analyze_array_mult(IrAnalyze *ira, IrInstructionBinOp |
| 9697 | uint64_t old_array_len = array_type->data.array.len; | 9697 | uint64_t old_array_len = array_type->data.array.len; |
| 9698 | uint64_t new_array_len; | 9698 | uint64_t new_array_len; |
| 9699 | | 9699 | |
| 9700 | if (__builtin_umulll_overflow((unsigned long long)old_array_len, (unsigned long long)mult_amt, | 9700 | if (__builtin_umulll_overflow((unsigned long long)old_array_len, (unsigned long long)mult_amt, |
| 9701 | (unsigned long long*)&new_array_len)) | 9701 | (unsigned long long*)&new_array_len)) |
| 9702 | { | 9702 | { |
| 9703 | ir_add_error(ira, &instruction->base, buf_sprintf("operation results in overflow")); | 9703 | ir_add_error(ira, &instruction->base, buf_sprintf("operation results in overflow")); |
| ... | @@ -14396,7 +14396,7 @@ static TypeTableEntry *ir_analyze_instruction_fn_proto(IrAnalyze *ira, IrInstruc | ... | @@ -14396,7 +14396,7 @@ static TypeTableEntry *ir_analyze_instruction_fn_proto(IrAnalyze *ira, IrInstruc |
| 14396 | } | 14396 | } |
| 14397 | } | 14397 | } |
| 14398 | IrInstruction *param_type_value = instruction->param_types[fn_type_id.next_param_index]->other; | 14398 | IrInstruction *param_type_value = instruction->param_types[fn_type_id.next_param_index]->other; |
| 14399 | if (type_is_invalid(param_type_value->value.type)) | 14399 | if (type_is_invalid(param_type_value->value.type)) |
| 14400 | return ira->codegen->builtin_types.entry_invalid; | 14400 | return ira->codegen->builtin_types.entry_invalid; |
| 14401 | | 14401 | |
| 14402 | FnTypeParamInfo *param_info = &fn_type_id.param_info[fn_type_id.next_param_index]; | 14402 | FnTypeParamInfo *param_info = &fn_type_id.param_info[fn_type_id.next_param_index]; |