You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include <v1model.p4>
header h_t {
bit<8> f;
}
struct my_packet {
h_t h;
}
struct my_metadata {
}
parser MyParser(packet_in b, out my_packet p, inout my_metadata m, inout standard_metadata_t s) {
state start {
transition accept;
}
}
control MyVerifyChecksum(in my_packet hdr, inout my_metadata meta) {
apply { }
}
control MyIngress(inout my_packet p, inout my_metadata m, inout standard_metadata_t s) {
apply {
bit<1> b = (bit<1>) { 0 };
}
}
control MyEgress(inout my_packet p, inout my_metadata m, inout standard_metadata_t s) {
apply { }
}
control MyComputeChecksum(inout my_packet p, inout my_metadata m) {
apply { }
}
control MyDeparser(packet_out b, in my_packet p) {
apply { }
}
/* Instantiate */
MyParser() p;
MyVerifyChecksum() vck;
MyIngress() i;
MyEgress() e;
MyComputeChecksum() cck;
MyDeparser() dp;
V1Switch(p, vck, i, e, cck, dp) main;
Error:
terminate called after throwing an instance of 'Util::CompilerBug'
what(): COMPILER BUG: ../frontends/common/constantFolding.cpp:631
/home/vagrant/min.p4(27): {0};: expected a boolean literal
bit<1> b = (bit<1>) { 0 };
^^^^^
Aborted (core dumped)
The text was updated successfully, but these errors were encountered:
The case for IR::Cast had a bug where it assumed that a constant was either a boolean or numeric literal. This pull request adds an extra case to handle list literals as well as a test case (`issue401.p4`). Fixes#401.
hanw
pushed a commit
to hanw/p4c
that referenced
this issue
Apr 4, 2017
The case for IR::Cast had a bug where it assumed that a constant was either a boolean or numeric literal. This pull request adds an extra case to handle list literals as well as a test case (`issue401.p4`). Fixesp4lang#401.
Program:
Error:
The text was updated successfully, but these errors were encountered: