Skip to content

Commit

Permalink
Switch statement not correctly translated when default case is not pr…
Browse files Browse the repository at this point in the history
…esent
  • Loading branch information
github-sajan committed Dec 20, 2021
1 parent 71063aa commit dea163f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions testdata/p4_16_samples_outputs/issue383-bmv2-midend.p4
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ struct col_t {
}

struct local_metadata_t {
@field_list(0)
@field_list(0)
bit<1> _row0_alt0_valid0;
@field_list(0)
@field_list(0)
bit<7> _row0_alt0_port1;
@field_list(0)
@field_list(0)
bit<1> _row0_alt1_valid2;
@field_list(0)
@field_list(0)
bit<7> _row0_alt1_port3;
bit<1> _row1_alt0_valid4;
bit<7> _row1_alt0_port5;
Expand Down Expand Up @@ -140,4 +140,3 @@ control compute_checksum(inout parsed_packet_t hdr, inout local_metadata_t local
}

V1Switch<parsed_packet_t, local_metadata_t>(parse(), verifyChecksum(), ingress(), egress(), compute_checksum(), deparser()) main;

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct user_meta_t {
bit<32> psa_ingress_input_metadata_ingress_port
bit<32> psa_ingress_input_metadata_packet_path
bit<64> psa_ingress_input_metadata_ingress_timestamp
bit<8> psa_ingress_input_metadata_parser_error
bit<16> psa_ingress_input_metadata_parser_error
bit<8> psa_ingress_output_metadata_class_of_service
bit<8> psa_ingress_output_metadata_clone
bit<16> psa_ingress_output_metadata_clone_session_id
Expand All @@ -66,7 +66,7 @@ struct user_meta_t {
bit<32> psa_egress_input_metadata_packet_path
bit<16> psa_egress_input_metadata_instance
bit<64> psa_egress_input_metadata_egress_timestamp
bit<8> psa_egress_input_metadata_parser_error
bit<16> psa_egress_input_metadata_parser_error
bit<32> psa_egress_deparser_input_metadata_egress_port
bit<8> psa_egress_output_metadata_clone
bit<16> psa_egress_output_metadata_clone_session_id
Expand Down

0 comments on commit dea163f

Please sign in to comment.