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

Allow method calls in index expressions in hsIndexSimplify #4240

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

vlstill
Copy link
Contributor

@vlstill vlstill commented Nov 10, 2023

Before this, the compiler would fail i.e. on

hdr.h2.f3 = hdr.hs[r0.read((bit<32>)hdr.h0.idx0)].f0;

-->

Internal error: In file: ./build/p4c/ir/ir-generated.cpp:4173
Compiler Bug: ./build/p4c/ir/ir-generated.cpp:4173: Null left

The failure is in validate() method because the aiFinder.newVariable is null when creating Eq constraint in eliminateArrayIndexes.

@vlstill vlstill added the core Topics concerning the core segments of the compiler (frontend, midend, parser) label Nov 10, 2023
@vlstill vlstill self-assigned this Nov 10, 2023
@vlstill vlstill force-pushed the fix-hs-index-simplify-method branch from 035260e to 6aa95c3 Compare November 13, 2023 06:58
@vlstill vlstill merged commit 4f26407 into p4lang:main Nov 13, 2023
12 checks passed
@vlstill vlstill deleted the fix-hs-index-simplify-method branch November 13, 2023 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Topics concerning the core segments of the compiler (frontend, midend, parser)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants