Skip to content

Using nested struct in log_msg crash #5035

@jhavrane

Description

@jhavrane

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;

Metadata

Metadata

Assignees

Labels

coreTopics concerning the core segments of the compiler (frontend, midend, parser)

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions