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

Fix handling of non-Data expressions as primitive arguments #888

Merged

Conversation

antoninbas
Copy link
Member

When adding support for returning lvalues in the expression evaluation
engine (#839), we
introduced support for using expressions which do not evaluate to a
simple Data value as primitive arguments. In particular, we can use an
expression which evaluates to a Header object as a primitive
argument. However, the code responsible for parsing the bmv2 input JSON
and instantiating Action objects was treating all expressions used as
primitive arguments as "Data expressions", thus causing bmv2 to crash
when it was actually not the case.

Fixes #887

When adding support for returning lvalues in the expression evaluation
engine (#839), we
introduced support for using expressions which do not evaluate to a
simple Data value as primitive arguments. In particular, we can use an
expression which evaluates to a Header object as a primitive
argument. However, the code responsible for parsing the bmv2 input JSON
and instantiating Action objects was treating all expressions used as
primitive arguments as "Data expressions", thus causing bmv2 to crash
when it was actually not the case.

Fixes #887
@antoninbas antoninbas merged commit 7cc67a8 into master May 10, 2020
@antoninbas antoninbas deleted the antonin/fix-handling-of-non-data-expressions-as-action-args branch May 10, 2020 07:48
antoninbas added a commit that referenced this pull request May 11, 2020
A recent fix for a separate issue
(#888) exposed a separate
bug: the type of expressions for which the top-level operator was
"access_field" was not deduced properly (set to UNKNOWN instead of
DATA), which caused bmv2 to assert when building the Action object.

The same issue existed for "access_union_header", which is an operator
introduced more recently (and possibly not used by p4c yet).

Fixes #889
antoninbas added a commit that referenced this pull request May 11, 2020
A recent fix for a separate issue
(#888) exposed a separate
bug: the type of expressions for which the top-level operator was
"access_field" was not deduced properly (set to UNKNOWN instead of
DATA), which caused bmv2 to assert when building the Action object.

The same issue existed for "access_union_header", which is an operator
introduced more recently (and possibly not used by p4c yet).

Fixes #889
antoninbas added a commit that referenced this pull request May 11, 2020
A recent fix for a separate issue
(#888) exposed a separate
bug: the type of expressions for which the top-level operator was
"access_field" was not deduced properly (set to UNKNOWN instead of
DATA), which caused bmv2 to assert when building the Action object.

The same issue existed for "access_union_header", which is an operator
introduced more recently (and possibly not used by p4c yet).

Fixes #889
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.

simple_switch died with return code -6
1 participant