| ... | ... | @@ -26394,6 +26394,7 @@ static IrInstruction *ir_analyze_instruction_check_switch_prongs(IrAnalyze *ira, |
| 26394 | 26394 | if (type_is_invalid(end_value->value->type)) |
| 26395 | 26395 | return ira->codegen->invalid_instruction; |
| 26396 | 26396 | |
| 26397 | assert(start_value->value->type->id == ZigTypeIdEnum); |
| 26397 | 26398 | BigInt start_index; |
| 26398 | 26399 | bigint_init_bigint(&start_index, &start_value->value->data.x_enum_tag); |
| 26399 | 26400 | |
| ... | ... | @@ -26401,6 +26402,11 @@ static IrInstruction *ir_analyze_instruction_check_switch_prongs(IrAnalyze *ira, |
| 26401 | 26402 | BigInt end_index; |
| 26402 | 26403 | bigint_init_bigint(&end_index, &end_value->value->data.x_enum_tag); |
| 26403 | 26404 | |
| 26405 | if (bigint_cmp(&start_index, &end_index) == CmpGT) { |
| 26406 | ir_add_error(ira, start_value, |
| 26407 | buf_sprintf("range start value is greater than the end value")); |
| 26408 | } |
| 26409 | |
| 26404 | 26410 | BigInt field_index; |
| 26405 | 26411 | bigint_init_bigint(&field_index, &start_index); |
| 26406 | 26412 | for (;;) { |
| ... | ... | @@ -26530,6 +26536,12 @@ static IrInstruction *ir_analyze_instruction_check_switch_prongs(IrAnalyze *ira, |
| 26530 | 26536 | |
| 26531 | 26537 | assert(start_val->type->id == ZigTypeIdInt || start_val->type->id == ZigTypeIdComptimeInt); |
| 26532 | 26538 | assert(end_val->type->id == ZigTypeIdInt || end_val->type->id == ZigTypeIdComptimeInt); |
| 26539 | |
| 26540 | if (bigint_cmp(&start_val->data.x_bigint, &end_val->data.x_bigint) == CmpGT) { |
| 26541 | ir_add_error(ira, start_value, |
| 26542 | buf_sprintf("range start value is greater than the end value")); |
| 26543 | } |
| 26544 | |
| 26533 | 26545 | AstNode *prev_node = rangeset_add_range(&rs, &start_val->data.x_bigint, &end_val->data.x_bigint, |
| 26534 | 26546 | start_value->source_node); |
| 26535 | 26547 | if (prev_node != nullptr) { |