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

Always call packet->reset_exit() at beginning of Pipeline::apply() #1279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jafingerhut
Copy link
Contributor

The only place the code checks for is_marked_for_exit() is inside of Pipeline::apply(), so by resetting exit flag at beginning of Pipeline::apply, no users of Pipeline class need to worry about the exit flag at all. It is handled completely locally within Pipeline::apply(), and could even be a local variable of Pipeline::appply() if the primitive made that straightforward (which it does not).

The only place the code checks for is_marked_for_exit() is inside of
Pipeline::apply(), so by resetting exit flag at beginning of
Pipeline::apply, no users of Pipeline class need to worry about the
exit flag at all.  It is handled completely locally within
Pipeline::apply(), and could even be a local variable of
Pipeline::appply() if the primitive made that straightforward (which
it does not).

Signed-off-by: Andy Fingerhut <andy_fingerhut@alum.wustl.edu>
@jafingerhut
Copy link
Contributor Author

jafingerhut commented Nov 10, 2024

I did not confirm whether there was a bug related to #1275, but in thinking about it a bit, the changes proposed in this PR seems to me to simplify the thinking about the question, and make it disappear as a concern. Users of the Pipeline class don't need to know about the exit flag at all, if Pipeline::apply() correctly initializes and uses it locally.

I ran a full test suite of p4c with these changes to behavioral-model, and they all passed.

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

Successfully merging this pull request may close these issues.

1 participant