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

crash when compiling program with return inside action #420

Closed
jafingerhut opened this issue Apr 2, 2017 · 2 comments
Closed

crash when compiling program with return inside action #420

jafingerhut opened this issue Apr 2, 2017 · 2 comments

Comments

@jafingerhut
Copy link
Contributor

Tested with 2017-Mar-30 version of p4test and p4c-bm2-ss, using attached program. Crash with return statement in action, no crash when the return statement in action is removed. P4_16 spec explicitly mentions allowing return statements in controls and actions. I found several test cases in p4c/testdata/p4_16_samples with return statements in controls, but none with return statements in actions.
crash-for-return-in-action.p4.txt

@mihaibudiu
Copy link
Contributor

The comment in your code is worried also about a warning being issued.
I think that the warning is actually OK, since the assignment in the 'if' is actually dead code; in the end the parameter ends up being dead code too.

mihaibudiu pushed a commit to mihaibudiu/p4c-clone that referenced this issue Apr 3, 2017
ChrisDodd pushed a commit that referenced this issue Apr 4, 2017
@jafingerhut
Copy link
Contributor Author

With this commit: a9dfc16

I have tested that the crash is gone, and no warnings or other problems occur, neither with p4test nor with p4c-bm2-ss, on the test program. Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants