Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler Bug in jsonconverter.cpp #172

Closed
jnfoster opened this issue Dec 8, 2016 · 1 comment
Closed

Compiler Bug in jsonconverter.cpp #172

jnfoster opened this issue Dec 8, 2016 · 1 comment

Comments

@jnfoster
Copy link
Contributor

jnfoster commented Dec 8, 2016

The following legal P4-16 program crashes on the Bmv2 backend:

#include <v1model.p4>

header d {
  bit<8> f;
}

struct h { 
  d[5] s;
}

struct m {
  bit<3> counter;
}

parser MyParser(packet_in b, out h hdrs, inout m meta, inout standard_metadata_t std) {
  state start {
    meta.counter = 4;
    transition q0;
  }
  state q0 {
    b.extract(hdrs.s.next);
    transition select(hdrs.s.last.f) {
      0x3f &&& 0x80: q1;
      default: q2;
    }
  }
  state q1 {
    b.extract(hdrs.s[meta.counter]);
    meta.counter = meta.counter - 1;
    transition q2;
  }
  state q2 {
    transition select((bit<1>)hdrs.s.full) {
      0: q0;
      1: accept;
    }
  }
}

control MyVerifyChecksum(in h hdr, inout m meta) {
  apply {}
}
control MyIngress(inout h hdr, inout m meta, inout standard_metadata_t std) {
  apply { }
}
control MyEgress(inout h hdr, inout m meta, inout standard_metadata_t std) {
  apply { }
}

control MyComputeChecksum(inout h hdr, inout m meta) {
  apply {}
}
control MyDeparser(packet_out b, in h hdr) {
  apply { }
}

V1Switch(MyParser(), MyVerifyChecksum(), MyIngress(), MyEgress(), MyComputeChecksum(), MyDeparser()) main;
@sethfowler
Copy link
Contributor

I'm closing this because d5cb9ea seems to have fixed it. If that's not true, please reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants