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

Another expression with side-effects in table keys and actions #2362

Closed
fruffy opened this issue May 4, 2020 · 0 comments
Closed

Another expression with side-effects in table keys and actions #2362

fruffy opened this issue May 4, 2020 · 0 comments
Assignees
Labels
bug This behavior is unintended and should be fixed. fixed This topic is considered to be fixed.

Comments

@fruffy
Copy link
Collaborator

fruffy commented May 4, 2020

Just for completeness, another expression that causes a compiler crash in tables is table.apply.hit()

control ingress(inout Headers h, inout Meta m, inout standard_metadata_t sm) {

    table sub_table {
        key = {
            h.eth_hdr.eth_type: exact @name("dummy_name") ;
        }
        actions = {
        }
    }

    table simple_table {
        key = {
            sub_table.apply().hit: exact @name("dummy_name") ;
        }
        actions = {
        }
    }
    apply {
        simple_table.apply();
    }
}

The error is:

FrontEnd_30_SimplifyControlFlow
FrontEnd_31_MoveDeclarations
P4::TypeChecking_0_ResolveReferences
P4::TypeChecking_1_TypeInference
SimplifyDefUse_0_TypeChecking
In file: p4_tv/p4c/frontends/p4/def_use.h:351
Compiler Bug: no definitions found for h.eth_hdr.eth_type

2258c.p4.txt

@fruffy fruffy changed the title Another expression with side-effects in table key and actions Another expression with side-effects in table keys and actions May 4, 2020
@mihaibudiu mihaibudiu self-assigned this May 4, 2020
@mihaibudiu mihaibudiu added the bug This behavior is unintended and should be fixed. label May 4, 2020
@mihaibudiu mihaibudiu added the fixed This topic is considered to be fixed. label Jun 21, 2021
@fruffy fruffy closed this as completed Nov 6, 2021
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. fixed This topic is considered to be fixed.
Projects
None yet
Development

No branches or pull requests

2 participants