| ... | ... | @@ -13734,7 +13734,7 @@ static IrInstruction *ir_analyze_bit_shift(IrAnalyze *ira, IrInstructionBinOp *b |
| 13734 | 13734 | return ira->codegen->invalid_instruction; |
| 13735 | 13735 | |
| 13736 | 13736 | if (op1->value.type->id != ZigTypeIdInt && op1->value.type->id != ZigTypeIdComptimeInt) { |
| 13737 | | ir_add_error(ira, &bin_op_instruction->base, |
| 13737 | ir_add_error(ira, bin_op_instruction->op1, |
| 13738 | 13738 | buf_sprintf("bit shifting operation expected integer type, found '%s'", |
| 13739 | 13739 | buf_ptr(&op1->value.type->name))); |
| 13740 | 13740 | return ira->codegen->invalid_instruction; |
| ... | ... | @@ -13744,6 +13744,13 @@ static IrInstruction *ir_analyze_bit_shift(IrAnalyze *ira, IrInstructionBinOp *b |
| 13744 | 13744 | if (type_is_invalid(op2->value.type)) |
| 13745 | 13745 | return ira->codegen->invalid_instruction; |
| 13746 | 13746 | |
| 13747 | if (op2->value.type->id != ZigTypeIdInt && op2->value.type->id != ZigTypeIdComptimeInt) { |
| 13748 | ir_add_error(ira, bin_op_instruction->op2, |
| 13749 | buf_sprintf("shift amount has to be an integer type, but found '%s'", |
| 13750 | buf_ptr(&op2->value.type->name))); |
| 13751 | return ira->codegen->invalid_instruction; |
| 13752 | } |
| 13753 | |
| 13747 | 13754 | IrInstruction *casted_op2; |
| 13748 | 13755 | IrBinOp op_id = bin_op_instruction->op_id; |
| 13749 | 13756 | if (op1->value.type->id == ZigTypeIdComptimeInt) { |