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

Using nested struct in log_msg crash #5035

Open
jhavrane opened this issue Nov 26, 2024 · 0 comments · May be fixed by #5036
Open

Using nested struct in log_msg crash #5035

jhavrane opened this issue Nov 26, 2024 · 0 comments · May be fixed by #5036
Assignees
Labels
bug This behavior is unintended and should be fixed. core Topics concerning the core segments of the compiler (frontend, midend, parser)

Comments

@jhavrane
Copy link
Contributor

Log

Error compiling
In file: ../../../p4c/frontends/p4/typeMap.cpp:118
Compiler Bug: Could not find type for <Member>(117596) .hdr

Program

// Include log_msg
#include <v1model.p4>

header h0_t {
    bit<32> f0;
    bit<32> f1;
}

struct struct_data_t {
    bit<3> f0;
    bit<5> f1;
    bit<8> f2;
}

struct data_t {
    h0_t hdr;
    struct_data_t data;
    bit<32> field;
}

parser SimpleParser(inout data_t d);
package SimpleArch(SimpleParser p);

parser ParserImpl(inout data_t d)
{
    state start {
        log_msg("Flattened hierarchical data: {}", {d});
        transition accept;
    }
}

SimpleArch(ParserImpl()) main;
@jhavrane jhavrane added bug This behavior is unintended and should be fixed. core Topics concerning the core segments of the compiler (frontend, midend, parser) labels Nov 26, 2024
@jhavrane jhavrane self-assigned this Nov 26, 2024
@jhavrane jhavrane changed the title Using hierarchical struct in log_msg crash Using nested struct in log_msg crash Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This behavior is unintended and should be fixed. core Topics concerning the core segments of the compiler (frontend, midend, parser)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant