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
Compiler bug triggered, please report this error:
exception type: Util::CompilerBug
error: In file: ./p4c/frontends/p4/typeChecking/typeChecker.cpp:172
Compiler Bug: main.p4(12): At this point in the compilation typechecking should not infer new types anymore, but it did: node packet.emit<hdr_t>({0}); changed to packet.emit<hdr_t>({
f0:0; });
packet.emit(h);
^^^^^^^^^^^^^^
main.p4(12)
packet.emit(h);
^^^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered:
I agree that improving the compiler to no longer experience a CompilerBug for such a program would be nice.
I only wanted to mention that probably one of the reasons that this has not been reported before is that it is extremely common for a deparser to take a parameter that is a struct type containing the header variables to be emitted, whereas this program has a deparser that takes exactly one header-type parameter to be emitted. Thus it seems that while enhancing the compiler to avoid this CompilerBug is a nice-to-have, it might not be critical for actual P4 implementations to have.
The typechecker makes no assumptions on the number of controls or their arguments, this must be something else.
It's probably related to the constructor argument which is instantiated with a header, there aren't many tests with constructor arguments.
Yes, in fact the error message says that the error is that type inference changes the constructor argument to {f0: 0}. That is right, but it probably happens too late.
The program
crashes in frontend with the message
The text was updated successfully, but these errors were encountered: